Sending numeric data

The SybPreparedStatement extension supports 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 may 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 the precision and scale of the corresponding SQL object, whether it is a stored procedure parameter or a column.

The SybPreparedStatement extension used with the following method gives jConnect applications more control over the setBigDecimal 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.