org.firebirdsql.jdbc
Interface FirebirdStatement

All Superinterfaces:
java.sql.Statement, java.sql.Wrapper
All Known Subinterfaces:
FirebirdCallableStatement, FirebirdPreparedStatement
All Known Implementing Classes:
AbstractCallableStatement, AbstractPreparedStatement, AbstractStatement

public interface FirebirdStatement
extends java.sql.Statement

Firebird-specific extensions to the Statement interface.

Author:
Roman Rokytskyy

Field Summary
static int CLOSE_ALL_RESULTS
          The constant indicating that all ResultSet objects that have previously been kept open should be closed when calling getMoreResults.
static int CLOSE_CURRENT_RESULT
          The constant indicating that the current ResultSet object should be closed when calling getMoreResults.
static int KEEP_CURRENT_RESULT
          The constant indicating that the current ResultSet object should not be closed when calling getMoreResults.
 
Fields inherited from interface java.sql.Statement
EXECUTE_FAILED, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Method Summary
 java.sql.ResultSet getCurrentResultSet()
          Get current result set.
 int getDeletedRowsCount()
          Get number of deleted rows.
 int getInsertedRowsCount()
          Get number of inserted rows.
 java.lang.String getLastExecutionPlan()
          Get execution plan for the last executed statement.
 int getUpdatedRowsCount()
          Get number of updated rows.
 boolean hasOpenResultSet()
          Check if this statement has open result set.
 boolean isValid()
          Check if this statement is valid.
 
Methods inherited from interface java.sql.Statement
addBatch, cancel, clearBatch, clearWarnings, close, execute, execute, execute, execute, executeBatch, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isPoolable, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Field Detail

CLOSE_CURRENT_RESULT

static final int CLOSE_CURRENT_RESULT
The constant indicating that the current ResultSet object should be closed when calling getMoreResults.

Copied from JDBC 3.0 definition

See Also:
Constant Field Values

KEEP_CURRENT_RESULT

static final int KEEP_CURRENT_RESULT
The constant indicating that the current ResultSet object should not be closed when calling getMoreResults.

Copied from JDBC 3.0 definition

See Also:
Constant Field Values

CLOSE_ALL_RESULTS

static final int CLOSE_ALL_RESULTS
The constant indicating that all ResultSet objects that have previously been kept open should be closed when calling getMoreResults.

Copied from JDBC 3.0 definition

See Also:
Constant Field Values
Method Detail

getInsertedRowsCount

int getInsertedRowsCount()
                         throws java.sql.SQLException
Get number of inserted rows. You can call this method multiple times, it does not affect the JDBC result number.

Returns:
number of inserted rows or -1 if current result is result set.
Throws:
java.sql.SQLException - if database error occurs.

getUpdatedRowsCount

int getUpdatedRowsCount()
                        throws java.sql.SQLException
Get number of updated rows. You can call this method multiple times, it does not affect the JDBC result number.

Returns:
number of updated rows or -1 if current result is result set.
Throws:
java.sql.SQLException - if database error occurs.

getDeletedRowsCount

int getDeletedRowsCount()
                        throws java.sql.SQLException
Get number of deleted rows. You can call this method multiple times, it does not affect the JDBC result number.

Returns:
number of deleted rows or -1 if current result is result set.
Throws:
java.sql.SQLException - if database error occurs.

hasOpenResultSet

boolean hasOpenResultSet()
Check if this statement has open result set. Note, this method works correctly if auto-commit is disabled. In auto-commit mode it will always return false because from the statement's point of view result set is not open (in auto-commit mode complete result set is fetched and cached in wrapping object before returning from the Statement.getResultSet() method).

Returns:
true if there's already open result set associated with this statement, otherwise false.

getCurrentResultSet

java.sql.ResultSet getCurrentResultSet()
                                       throws java.sql.SQLException
Get current result set. Behaviour of this method is similar to the behavior of the Statement.getResultSet(), except that this method can be called as much as you like.

Returns:
instance of ResultSet representing current result set or null if it is not available.
Throws:
java.sql.SQLException - if database access error happened.

isValid

boolean isValid()
Check if this statement is valid.

Returns:
true if statement is valid and can be used to execute SQL.

getLastExecutionPlan

java.lang.String getLastExecutionPlan()
                                      throws java.sql.SQLException
Get execution plan for the last executed statement. Unlike the FirebirdPreparedStatement.getExecutionPlan(), this method can be called only after executing a query or update statement.

Returns:
execution plan returned by the server.
Throws:
java.sql.SQLException - if no statement was executed before calling this method, statement is not valid, or there was an error when obtaining the execution plan.


Copyright © 2001 David Jencks and other authors. All rights reserved.