BigDecimal rescaling

The JDBC 1.0 specification requires a scale factor with getBigDecimal. Then, when a BigDecimal object is returned from the server, it must be rescaled using the original scale factor you used with getBigDecimal.

To eliminate the processing time required for rescaling, use the JDBC 2.0 getBigDecimal method, which jConnect implements in the SybResultSet class and does not require a scale value:

public BigDecimal getBigDecimal(int columnIndex) 
   throws SQLException

For example:

SybResultSet rs = 
   (SybResultSet)stmt.executeQuery("SELECT 
   numeric_column from T1");
 while (rs.next())
 {
   BigDecimal bd rs.getBigDecimal( 
     "numeric_column");
      ...
 }