Statement Methods
|
Version Introduced
|
Supported
|
Comments
|
void addBatch(String)
|
2.0 Core
|
Yes
|
All drivers throw "invalid method call" exception for PreparedStatement and CallableStatement.
|
void cancel()
|
1.0
|
Yes
|
The DB2 driver cancels the execution of the statement with DB2 V8.x and higher for Linux/UNIX/Windows and DB2 V8.1 and higher for z/OS. If the statement is canceled by the database server, the driver throws an exception indicating that it was canceled. The DB2 driver throws an "unsupported method" exception with other DB2 versions.
The drivers for Apache Cassandra, Impala, Informix, MongoDB, Progess OpenEdge, Oracle Service Cloud, Oracle Eloqua, Oracle Sales Cloud, and Salesforce throw an "unsupported method" exception.
The Apache Hive, Apache Spark SQL1, Greenplum, Oracle, PostgreSQL, SQL Server, Sybase, and Amazon Redshift drivers cancel the execution of the statement. If the statement is canceled by the database server, the driver throws an exception indicating that it was canceled.
|
void clearBatch()
|
2.0 Core
|
Yes
|
|
void clearWarnings()
|
1.0
|
Yes
|
|
void close()
|
1.0
|
Yes
|
|
boolean execute(String)
|
1.0
|
Yes
|
All drivers throw "invalid method call" exception for PreparedStatement and CallableStatement.
|
boolean execute(String, int)
|
3.0
|
Yes
|
|
boolean execute(String, int [])
|
3.0
|
Yes
|
Supported for the Oracle and SQL Server drivers.
All other drivers throw "unsupported method" exception.
|
boolean execute(String, String [])
|
3.0
|
Yes
|
Supported for the Oracle and SQL Server drivers.
All other drivers throw "unsupported method" exception.
|
int [] executeBatch()
|
2.0 Core
|
Yes
|
|
ResultSet executeQuery(String)
|
1.0
|
Yes
|
All drivers throw "invalid method call" exception for PreparedStatement and CallableStatement.
|
int executeUpdate(String)
|
1.0
|
Yes
|
All drivers throw "invalid method call" exception for PreparedStatement and CallableStatement.
|
int executeUpdate(String, int)
|
3.0
|
Yes
|
|
int executeUpdate(String, int [])
|
3.0
|
Yes
|
Supported for the Oracle and SQL Server drivers.
All other drivers throw "unsupported method" exception.
|
int executeUpdate(String, String [])
|
3.0
|
Yes
|
Supported for the Oracle and SQL Server drivers.
All other drivers throw "unsupported method" exception.
|
Connection getConnection()
|
2.0 Core
|
Yes
|
|
int getFetchDirection()
|
2.0 Core
|
Yes
|
|
int getFetchSize()
|
2.0 Core
|
Yes
|
|
ResultSet getGeneratedKeys()
|
3.0
|
Yes
|
The DB2, SQL Server, and Sybase drivers return the last value inserted into an identity column. If an identity column does not exist in the table, the drivers return an empty result set.
The Informix driver returns the last value inserted into a Serial or Serial8 column. If a Serial or Serial8 column does not exist in the table, the driver returns an empty result set.
The Oracle driver returns the ROWID of the last row that was inserted.
The drivers for Apache Cassandra, MongoDB, Oracle Eloqua, Oracle Service Cloud, and Salesforce return the ID of the last row that was inserted.
Auto-generated keys are not supported in any of the other drivers.
|
int getMaxFieldSize()
|
1.0
|
Yes
|
|
int getMaxRows()
|
1.0
|
Yes
|
|
boolean getMoreResults()
|
1.0
|
Yes
|
|
boolean getMoreResults(int)
|
3.0
|
Yes
|
|
int getQueryTimeout()
|
1.0
|
Yes
|
The DB2 driver returns the timeout value, in seconds, set for the statement with DB2 V8.x and higher for Linux/UNIX/Windows and DB2 V8.1 and higher for z/OS. The DB2 driver returns 0 with other DB2 versions.
The Apache Hive, Apache Spark SQL, Impala, Informix and Progress OpenEdge drivers return 0.
The drivers for Apache Cassandra, Greenplum, Oracle, PostgreSQL, SQL Server, Sybase, and Amazon Redshift return the timeout value, in seconds, set for the statement.
The drivers for Oracle Eloqua, Oracle Sales Cloud, Oracle Service Cloud, and Salesforce return an "unsupported method" exception.
|
ResultSet getResultSet()
|
1.0
|
Yes
|
|
int getResultSetConcurrency()
|
2.0 Core
|
Yes
|
|
int getResultSetHoldability()
|
3.0
|
Yes
|
|
int getResultSetType()
|
2.0 Core
|
Yes
|
|
int getUpdateCount()
|
1.0
|
Yes
|
|
SQLWarning getWarnings()
|
1.0
|
Yes
|
|
boolean isClosed()
|
4.0
|
Yes
|
|
boolean isPoolable()
|
4.0
|
Yes
|
|
boolean isWrapperFor(Class<?> iface)
|
4.0
|
Yes
|
|
void setCursorName(String)
|
1.0
|
No
|
Throws "unsupported method" exception.
|
void setEscapeProcessing(boolean)
|
1.0
|
Yes
|
Ignored.
|
void setFetchDirection(int)
|
2.0 Core
|
Yes
|
|
void setFetchSize(int)
|
2.0 Core
|
Yes
|
|
void setMaxFieldSize(int)
|
1.0
|
Yes
|
|
void setMaxRows(int)
|
1.0
|
Yes
|
|
void setPoolable(boolean)
|
4.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 drivers for Apache Hive, Apache Spark SQL, Impala, and Informix throw an "unsupported method" exception.
The drivers for Greenplum, Oracle, PostgreSQL, Progress OpenEdge, SQL Server, Sybase, and Amazon Redshift 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.
The drivers for Oracle Eloqua, Oracle Sales Cloud, Oracle Service Cloud, and Salesforce ignore any value set using this method. Use the WSTimeout connection property to set a timeout.
The drivers for Apache Cassandra and MongoDB driver ignore any value set using this method.
|
<T> T unwrap(Class<T> iface)
|
4.0
|
Yes
|