From: <pj...@us...> - 2009-05-07 04:15:21
|
Revision: 6314 http://jython.svn.sourceforge.net/jython/?rev=6314&view=rev Author: pjenvey Date: 2009-05-07 04:15:11 +0000 (Thu, 07 May 2009) Log Message: ----------- o revert the deprecated getBigDecimal postgresql driver workaround, this problem was resolved long ago o suppress warnings in the old, preserved Jython22DataHandler Modified Paths: -------------- trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java Modified: trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java =================================================================== --- trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java 2009-05-07 03:48:51 UTC (rev 6313) +++ trunk/jython/src/com/ziclix/python/sql/Jython22DataHandler.java 2009-05-07 04:15:11 UTC (rev 6314) @@ -210,6 +210,7 @@ * @param type the column type * @throws SQLException if the type is unmappable */ + @SuppressWarnings("deprecation") public PyObject getPyObject(ResultSet set, int col, int type) throws SQLException { PyObject obj = Py.None; @@ -326,6 +327,7 @@ * @param type the column type * @throws SQLException if the type is unmappable */ + @SuppressWarnings("deprecation") public PyObject getPyObject(CallableStatement stmt, int col, int type) throws SQLException { PyObject obj = Py.None; Modified: trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java =================================================================== --- trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java 2009-05-07 03:48:51 UTC (rev 6313) +++ trunk/jython/src/com/ziclix/python/sql/handler/PostgresqlDataHandler.java 2009-05-07 04:15:11 UTC (rev 6314) @@ -60,14 +60,7 @@ case Types.NUMERIC: case Types.DECIMAL: - // in JDBC 2.0, use of a scale is deprecated - // The big fix here is a problem with numeric types. It seems the ResultSet - // tries to fix a JBuilder bug (as commented in the source) by including a - // scale of 0. Well this blows up BigDecimal if the number is, say, 4.22. - // It appears the workaround is to call the deprecated method with a scale of - // -1 which forces the return of the BD without setting the scale. - BigDecimal bd = set.getBigDecimal(col, -1); - + BigDecimal bd = set.getBigDecimal(col); obj = (bd == null) ? Py.None : Py.newFloat(bd.doubleValue()); break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |