Hitachi

Hitachi Advanced Database Application Development Guide


8.4.35 Notes about the PreparedStatement interface

The PreparedStatement interface is a subinterface of the Statement interface. For this reason, the notes for the Statement interface also apply to the PreparedStatement interface.

This section describes additional notes that apply to the PreparedStatement interface.

Organization of this subsection

(1) Dynamic parameter setup

(2) Value specifications for dynamic parameters of HADB's DECIMAL type

This subsection describes the operations that are executed when a setXXX method is used to specify a value for a dynamic parameter of HADB's DECIMAL type, and when the precision and scaling of the dynamic parameter do not match the precision and scaling of the specified value.

(3) Value specifications for dynamic parameters of HADB's TIME and TIMESTAMP types

If a data type with a high fractional second precision is specified for a data type with a low fractional second precision, the differential fractional second precision is discarded. On the other hand, if a data type with a low fractional second precision is specified for a data type with a high fractional second precision, the resulting value is extended with zeros padded for the differential fractional second precision.

(4) Value specifications for dynamic parameters of HADB's CHAR and VARCHAR types

When a setXXX method is used to specify a value for a dynamic parameter of HADB's CHAR or VARCHAR type, and when the length of the value after conversion to a character string representation is greater than the defined length of the dynamic parameter, the JDBC driver throws an SQLException.

(5) Objects that can be specified with setObject

Objects of the following types can be specified for the x argument of the setObject method: