PreparedStatement Methods
|
Version Introduced
|
Supported
|
Comments
|
void addBatch()
|
2.0 Core
|
Yes
|
|
void clearParameters()
|
1.0
|
Yes
|
|
boolean execute()
|
1.0
|
Yes
|
|
ResultSet executeQuery()
|
1.0
|
Yes
|
|
int executeUpdate()
|
1.0
|
Yes
|
|
ResultSetMetaData getMetaData()
|
2.0 Core
|
Yes
|
|
ParameterMetaData getParameterMetaData()
|
3.0
|
Yes
|
|
boolean isWrapperFor(Class<?> iface)
|
4.0
|
Yes
|
|
void setArray(int, Array)
|
2.0 Core
|
Yes
|
Supported for the Oracle driver only.
All other drivers throw an "unsupported method" exception.
|
void setAsciiStream(int, InputStream)
|
4.0
|
Yes
|
|
void setAsciiStream(int, InputStream, int)
|
1.0
|
Yes
|
|
void setAsciiStream(int, InputStream, long)
|
4.0
|
Yes
|
|
void setBigDecimal(int, BigDecimal)
|
1.0
|
Yes
|
|
void setBinaryStream(int, InputStream)
|
4.0
|
Yes
|
When used with Blobs, the DB2 driver only supports with DB2 V8.x and higher for Linux/UNIX/Windows, DB2 for z/OS (all versions), and DB2 for i.
|
void setBinaryStream(int, InputStream, int)
|
1.0
|
Yes
|
When used with Blobs, the DB2 driver only supports with DB2 V8.x and higher for Linux/UNIX/Windows, DB2 for z/OS (all versions), and DB2 for i.
|
void setBinaryStream(int, InputStream, long)
|
4.0
|
Yes
|
When used with Blobs, the DB2 driver only supports with DB2 V8.x and higher for Linux/UNIX/Windows, DB2 for z/OS (all versions), and DB2 for i.
|
void setBlob(int, Blob)
|
2.0 Core
|
Yes
|
The DB2 driver only supports with DB2 V8.x and higher for Linux/UNIX/Windows, DB2 for z/OS (all versions), and DB2 for i.
All other drivers support using with data types that map to the JDBC LONGVARBINARY data type.
|
void setBlob(int, InputStream)
|
4.0
|
Yes
|
The DB2 driver only supports with DB2 V8.x and higher for Linux/UNIX/Windows, DB2 for z/OS (all versions), and DB2 for i.
All other drivers support using with data types that map to the JDBC LONGVARBINARY data type.
|
void setBlob(int, InputStream, long)
|
4.0
|
Yes
|
The DB2 driver only supports with DB2 V8.x and higher for Linux/UNIX/Windows, DB2 for z/OS (all versions), and DB2 for i.
All other drivers support using with data types that map to the JDBC LONGVARBINARY data type.
|
void setBoolean(int, boolean)
|
1.0
|
Yes
|
|
void setByte(int, byte)
|
1.0
|
Yes
|
|
void setBytes(int, byte [])
|
1.0
|
Yes
|
When used with Blobs, the DB2 driver only supports with DB2 V8.x and higher for Linux/UNIX/Windows, DB2 for z/OS (all versions), and DB2 for i.
|
void setCharacterStream(int, Reader)
|
4.0
|
Yes
|
|
void setCharacterStream(int, Reader, int)
|
2.0 Core
|
Yes
|
|
void setCharacterStream(int, Reader, long)
|
4.0
|
Yes
|
|
void setClob(int, Clob)
|
2.0 Core
|
Yes
|
Drivers support using with data types that map to the JDBC LONGVARBINARY data type.
|
void setClob(int, Reader)
|
4.0
|
Yes
|
Drivers support using with data types that map to the JDBC LONGVARBINARY data type.
|
void setClob(int, Reader, long)
|
4.0
|
Yes
|
Drivers support using with data types that map to the JDBC LONGVARBINARY data type.
|
void setDate(int, Date)
|
1.0
|
Yes
|
|
void setDate(int, Date, Calendar)
|
2.0 Core
|
Yes
|
|
void setDouble(int, double)
|
1.0
|
Yes
|
|
void setFloat(int, float)
|
1.0
|
Yes
|
|
void setInt(int, int)
|
1.0
|
Yes
|
|
void setLong(int, long)
|
1.0
|
Yes
|
|
void setNCharacterStream(int, Reader)
|
4.0
|
Yes
|
For the drivers for Salesforce, Oracle Service Cloud, and MongoDB, N methods are identical to their non-N counterparts.
|
void setNCharacterStream(int, Reader, long)
|
4.0
|
Yes
|
For the drivers for Salesforce, Oracle Service Cloud, and MongoDB,N methods are identical to their non-N counterparts.
|
void setNClob(int, NClob)
|
4.0
|
Yes
|
For the drivers for Salesforce, Oracle Service Cloud, and MongoDB, N methods are identical to their non-N counterparts.
|
void setNClob(int, Reader)
|
4.0
|
Yes
|
For the drivers for Salesforce, Oracle Service Cloud, and MongoDB, N methods are identical to their non-N counterparts.
|
void setNClob(int, Reader, long)
|
4.0
|
Yes
|
For the drivers for Salesforce, Oracle Service Cloud, and MongoDB, N methods are identical to their non-N counterparts.
|
void setNull(int, int)
|
1.0
|
Yes
|
|
void setNull(int, int, String)
|
2.0 Core
|
Yes
|
|
void setNString(int, String)
|
4.0
|
Yes
|
|
void setObject(int, Object)
|
1.0
|
Yes
|
|
void setObject(int, Object, int)
|
1.0
|
Yes
|
|
void setObject(int, Object, int, int)
|
1.0
|
Yes
|
|
void setQueryTimeout(int)
|
1.0
|
Yes
|
The DB2 driver supports setting a timeout value, in seconds, for a statement with DB2 V8.x and higher for Linux/UNIX/Windows and DB2 V8.1 and higher for z/OS. If the execution of the statement exceeds the timeout value, the statement is timed out by the database server, and the driver throws an exception indicating that the statement was timed out. The DB2 driver throws an "unsupported method" exception with other DB2 versions.
The Informix driver throws an "unsupported method" exception.
The drivers for Salesforce and Oracle Service Cloud ignore any value set using this method. Use the WSTimeout connection property to set a timeout value.
The MongoDB driver ignores any value set using this method.
All other drivers support setting a timeout value, in seconds, for a statement. If the execution of the statement exceeds the timeout value, the statement is timed out by the database server, and the driver throws an exception indicating that the statement was timed out.
|
void setRef(int, Ref)
|
2.0 Core
|
No
|
All drivers throw "unsupported method" exception.
|
void setShort(int, short)
|
1.0
|
Yes
|
|
void setSQLXML(int, SQLXML)
|
4.0
|
Yes
|
|
void setString(int, String)
|
1.0
|
Yes
|
|
void setTime(int, Time)
|
1.0
|
Yes
|
|
void setTime(int, Time, Calendar)
|
2.0 Core
|
Yes
|
|
void setTimestamp(int, Timestamp)
|
1.0
|
Yes
|
|
void setTimestamp(int, Timestamp, Calendar)
|
2.0 Core
|
Yes
|
|
void setUnicodeStream(int, InputStream, int)
|
1.0
|
No
|
This method was deprecated in JDBC 2.0. All drivers throw "unsupported method" exception.
|
<T> T unwrap(Class<T> iface)
|
4.0
|
Yes
|
|
void setURL(int, URL)
|
3.0
|
No
|
All drivers throw "unsupported method" exception.
|