Statement interface

The Statement interface creates an object that is used to execute a static SQL statement and obtain the results produced by it.

java.sql package

public interface Statement

Tabulka 106 lists the methods in the Statement interface that are supported by DB2 Everyplace.

Tabulka 106. Statement interface methods

Method return value type Method
void addBatch(String sql) JDBC 2.0 Adds a SQL command to the current batch of commmands for the statement.
void clearBatch() JDBC 2.0 Makes the set of commands in the current batch empty.
void close() Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closes.
boolean execute( String sql) Executes an SQL statement that might return multiple results.
int[] executeBatch() JDBC 2.0 Submits a batch of commands to the database for execution.
ResultSet executeQuery( String sql) Executes an SQL statement that returns a single ResultSet object.
int executeUpdate( String sql) Executes an SQL INSERT, UPDATE, or DELETE statement.
Connection getConnection () JDBC 2.0. Returns the Connection object that produced this Statement object.
boolean getMoreResults() Moves to a Statement's next result. DB2 Everyplace always returns false (there are no more results).
ResultSet getResultSet() Returns the current result as a ResultSet object.
int getResultSetConcurrency() JDBC 2.0. Retrieves the result set concurrency.
int getResultSetType() JDBC 2.0. Determines the result set type.
int getUpdateCount() Returns the current result as an update count; if the result is a ResultSet or there are no more results, -1 is returned.

Tabulka 107 lists the fields in the Statement interface that are supported by DB2 Everyplace.

Tabulka 107. Statement interface fields

Field type Field
static int SUCCESS_NO_INFO The constant indicating that a batch statement executed successfully, but that no count of the number of rows it affected is available.

Související úlohy

Související odkazy