setObject(int parameterIndex, Object x, int targetSqlType)

Syntax:

void setObject(int parameterIndex,
               Object x,
               int targetSqlType)
               throws SQLException

Description:

Sets the value of the designated parameter with the given object. This method is like the method setObject above, except that it assumes a scale of zero.

Parameters:

parameterIndex

the first parameter is 1, the second is 2, ...

x

the parameter value

targetSqlType

the SQL type (as defined in java.sql.Types) to be sent to the database

Throws:

SQLException - if a database access error occurs, parameterIndex is less than 1 or greater than the number of parameters, x is ambiguous or not a valid database type, or the prepared statement has been closed

SQLFeatureNotSupportedException - if targetSqlType is a ARRAY, DATALINK, JAVA_OBJECT, REF, ROWID, SQLXML, or STRUCT.

Reference:

For more information, reference JDBC documentation for: PreparedStatement.setObject(int, Object, int)