Statement
- Last Updated: June 27, 2025
- 1 minute read
- DataDirect Connectors
- JDBC
- Aha! 6.0
- Amazon Redshift 6.0
- Apache Cassandra 6.0
- Apache Hive 6.0
- Apache Spark SQL 6.0
- Atlassian Jira 6.0
- Autonomous REST Connector 6.0
- Cloudera Impala 5.1
- + 24
| 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 for Linux/UNIX/Windows and Db2 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 Autonomous REST Connector and the drivers for Aha!, Apache Cassandra, Dynamics 365, GitHub, Google Analytics 4, Google BigQuery, HubSpot, Apache Impala, Informix, Jira, MongoDB, Oracle Service Cloud, Oracle Eloqua, Oracle Sales Cloud, Salesforce, SAP HANA, SAP S/4HANA, SharePoint, and TeamCity throw an "unsupported method" exception. The Apache Hive, Apache Spark SQL1 Amazon Redshift, Denodo, Greenplum, Oracle, PostgreSQL, SQL Server, and Sybase 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. The OpenEdge driver supports this method for SELECT statements with OpenEdge V12.4 and higher. If a SELECT statement is cancelled during the first or a subsequent fetch operation, the driver returns a "query aborted" exception. This method can be used by a thread to cancel a statement that is being executed by another thread. One or more statements may be cancelled if the method is called on a statement object that is executing multiple statements simultaneously and the driver may not return expected results. |
| 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 Autonomous REST Connector and the drivers for Aha!, Apache Cassandra, Dynamics 365, GitHub, Google Analytics 4, Google BigQuery, HubSpot, Jira, MongoDB, Oracle Eloqua, Oracle Service Cloud, Salesforce, SAP HANA, SAP S/4HANA, SharePoint, Snowflake, and TeamCity 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 for Linux/UNIX/Windows and
Db2 for z/OS. The Db2 driver returns 0 with other
Db2 versions. The Apache Hive, Apache Spark SQL, Apache Impala,
Informix and Progress OpenEdge drivers return The drivers for Amazon Redshift, Apache Cassandra, Denodo, Greenplum, Oracle, PostgreSQL, SQL Server, and Sybase return the timeout value, in seconds, set for the statement. The Autonomous REST Connector and the drivers for Aha!, Dynamics 365, GitHub, Google Analytics 4, Google BigQuery, HubSpot, Jira, Oracle Eloqua, Oracle Sales Cloud, Oracle Service Cloud, Salesforce, SAP HANA, SAP S/4HANA, SharePoint, and TeamCity 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 for Linux/UNIX/Windows and
Db2 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, Apache Impala, and Informix throw an "unsupported method" exception. The drivers for Amazon Redshift, Denodo, Greenplum, Oracle, PostgreSQL, Progress OpenEdge, SQL Server, and Sybase 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 Autonomous REST Connector and the drivers for Aha!, Dynamics 365, GitHub, Google Analytics 4, Google BigQuery, HubSpot, Jira, Oracle Eloqua, Oracle Sales Cloud, Oracle Service Cloud, Salesforce, SAP HANA, SAP S/4HANA, SharePoint, Snowflake, and TeamCity 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 |