- parameterIndex
- the parameter index, where the first parameter has index 1.
- theObject
- the Object containing the value to which the parameter at parameterIndex is set.
- targetSqlType
- the SQL type to send to the database, as defined in java.sql.Types.
- scale
- the number of digits after the decimal point - only applies to the types java.sql.Types.DECIMAL and java.sql.Types.NUMERIC - ignored for all other types.
Type Reason Java.Sql.SQLException if a database error happens.
Sets the value of a specified parameter using a supplied object.
The object is converted to the given targetSqlType before it is sent to the database. If the object has a custom mapping (its class implements the interface SQLData), the JDBC driver will call the method SQLData.writeSQL to write it to the SQL data stream. If the object's class implements Ref, Blob, Clob, Struct, or Array, the driver will pass it to the database in the form of the relevant SQL type.