Sending numeric data

jConnect has added the SybPreparedStatement extension to support the way Adaptive Server handles the NUMERIC datatype where precision (total digits) and scale (digits after the decimal) can be specified.The corresponding datatype in Java—java.math.BigDecimal—is slightly different, and these differences can cause problems when jConnect applications use the setBigDecimal method to control values of an input/output parameter. Specifically, there are cases where the precision and scale of the parameter must precisely match that precision and scale of the corresponding SQL object, whether it is a stored procedure parameter or a column.To give jConnect applications more control over the setBigDecimal method, the SybPreparedStatement extension has been added with this method:

public void setBigDecimal (int parameterIndex, BigDecimal X, int scale, 
  int precision) throws SQLException

See the SybPrepExtension.java sample in the /sample2 subdirectories under your jConnect installation directory for more information.