OSDN Git Service

Attached is a simple one line patch for the problem reported in the
authorBruce Momjian <bruce@momjian.us>
Wed, 22 Aug 2001 13:20:06 +0000 (13:20 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 22 Aug 2001 13:20:06 +0000 (13:20 +0000)
following email.

 > > The problem:  When I call getBigDecimal() on a ResultSet, it
 > > sometimes throws an exception:
 > >
 > >   Bad BigDecimal 174.50
 > >     at org.postgresql.jdbc2.ResultSet.getBigDecimal(ResultSet.java:373)
 > >     at org.postgresql.jdbc2.ResultSet.getBigDecimal(ResultSet.java:984)
 > >     ...blah blah blah...
 > >   org.postgresql.util.PSQLException: Bad BigDecimal 174.50

Barry Lind

src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java

index 6ff3b60..ad81a7c 100644 (file)
@@ -798,8 +798,7 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
 
     public java.math.BigDecimal getBigDecimal(int columnIndex) throws SQLException
     {
-      // Now must call BigDecimal with a scale otherwise JBuilder barfs
-      return getBigDecimal(columnIndex,0);
+      return getBigDecimal(columnIndex,-1);
     }
 
     public java.math.BigDecimal getBigDecimal(String columnName) throws SQLException