com.wrq.apptrieve.jdbc
Class ApptrieveStatement

java.lang.Object
  extended by com.wrq.apptrieve.jdbc.ApptrieveStatement
All Implemented Interfaces:
java.sql.Statement, java.sql.Wrapper
Direct Known Subclasses:
ApptrievePreparedStatement

public class ApptrieveStatement
extends java.lang.Object
implements java.sql.Statement


Field Summary
 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS, CLOSE_CURRENT_RESULT, EXECUTE_FAILED, KEEP_CURRENT_RESULT, NO_GENERATED_KEYS, RETURN_GENERATED_KEYS, SUCCESS_NO_INFO
 
Method Summary
 void addBatch(java.lang.String sql)
          The Host Integrator Driver does not support batch operations.
 void cancel()
          The Host Integrator Driver does not support canceling of a statement.
 void clearBatch()
          The Host Integrator Driver does not support batch operations.
 void clearWarnings()
          Clears all warnings for this statement
 void close()
          Immediately releases all resources for this Statement.
 boolean execute(java.lang.String sql)
          Executes an SQL statement.
 boolean execute(java.lang.String sql, int autoGeneratedKeys)
          This method is not supported by the Host Integrator driver.
 boolean execute(java.lang.String sql, int[] columnIndexes)
          This method is not supported by the Host Integrator driver.
 boolean execute(java.lang.String sql, java.lang.String[] columnNames)
          This method is not supported by the Host Integrator driver.
 int[] executeBatch()
          The Host Integrator Driver does not support batch operations.
 java.sql.ResultSet executeQuery(java.lang.String sql)
          Executes a SQL SELECT query statement and return a ResultSet
 int executeUpdate(java.lang.String sql)
          Executes an SQL UPDATE statement
 int executeUpdate(java.lang.String sql, int autoGeneratedKeys)
          This method is not supported by the Host Integrator driver.
 int executeUpdate(java.lang.String sql, int[] columnIndexes)
          This method is not supported by the Host Integrator driver.
 int executeUpdate(java.lang.String sql, java.lang.String[] columnNames)
          This method is not supported by the Host Integrator driver.
 java.sql.Connection getConnection()
          Gets the Connection object that produced this Statement object.
 int getConnectionTimeout()
          Gets the current connectionTimeout value The connectionTimeout limit is the number of seconds the driver will wait for a connection to complete.
 int getFetchDirection()
          Gets the fetch direction for this Statement object.
 int getFetchSize()
          Gets the fetch size for this Statement object.
 java.sql.ResultSet getGeneratedKeys()
           
 int getMaxFieldSize()
          Gets the maximum number of bytes that a ResultSet column may contain
 int getMaxRows()
          Gets the maximum number of rows that a ResultSet object can contain
 boolean getMoreResults()
          Fetches the next part of data from Host Integrator server.
 boolean getMoreResults(int current)
          Fetches the next part of data from Host Integrator server.
 int getQueryTimeout()
          Gets the current queryTimeout value The queryTimeout limit is the number of seconds the driver will wait for a Statement object to execute.
 java.sql.ResultSet getResultSet()
          Obtains the current result set from a Statement object.
 int getResultSetConcurrency()
          Obtains the concurrency mode for ResultSet objects generated from queries that this Statement object executes.
 int getResultSetHoldability()
          This method is not supported by the Host Integrator driver.
 int getResultSetType()
          Obtains the type of ResultSet objects generated from queries that this Statement object executes.
 int getUpdateCount()
          Gets the number of rows affected by the most recently executed SQL statement.
 java.sql.SQLWarning getWarnings()
          Host Integrator JDBC driver does not support warnings.
 boolean isClosed()
           
 boolean isPoolable()
           
 boolean isWrapperFor(java.lang.Class<?> iface)
           
 void setConnectionTimeout(int seconds)
          Sets the current connectionTimeout value The connectionTimeout limit is the number of seconds the driver will wait for a connection attempt to execute.
 void setCursorName(java.lang.String name)
          Host Integrator JDBC driver does not support cursors.
 void setEscapeProcessing(boolean enable)
          Host Integrator JDBC driver does not support escape processing.
 void setFetchDirection(int direction)
          Sets the fetch direction for this Statement object.
 void setFetchSize(int rows)
          Sets the fetch size for this Statement object.
 void setMaxFieldSize(int max)
          Sets the maximum length for a column in a ResultSet
 void setMaxRows(int max)
          Sets the maximum number of rows in a ResultSet
 void setPoolable(boolean poolable)
           
 void setQueryTimeout(int seconds)
          Sets the current queryTimeout value The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute.
<T> T
unwrap(java.lang.Class<T> iface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addBatch

public void addBatch(java.lang.String sql)
              throws java.sql.SQLException
The Host Integrator Driver does not support batch operations.

Specified by:
addBatch in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.addBatch(String)

cancel

public void cancel()
            throws java.sql.SQLException
The Host Integrator Driver does not support canceling of a statement.

Specified by:
cancel in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.cancel()

clearBatch

public void clearBatch()
                throws java.sql.SQLException
The Host Integrator Driver does not support batch operations.

Specified by:
clearBatch in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.clearBatch()

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Clears all warnings for this statement

Specified by:
clearWarnings in interface java.sql.Statement
Throws:
java.sql.SQLException
See Also:
Statement.clearWarnings()

close

public void close()
           throws java.sql.SQLException
Immediately releases all resources for this Statement. In many cases, it is desirable to immediately release a Statement's database and JDBC resources instead of waiting for this to happen when it is automatically closed; the close method provides this immediate release. This implementation simply deletes its internal reference to any existing result set so it will be eligible for garbage collection when it is no longer referenced externally. This statement is still usable for new queries.

Note: A Statement is automatically closed when it is garbage collected. When a Statement is closed, its current ResultSet, if one exists, is also closed.

Specified by:
close in interface java.sql.Statement
Throws:
java.sql.SQLException - if a database-access error occurs.
See Also:
Statement.close()

execute

public boolean execute(java.lang.String sql)
                throws java.sql.SQLException
Executes an SQL statement. Returns true if a result set was obtained, false otherwise. The Host Integrator Driver does not support multiple results set. The Host Integrator Driver supports four types of SQL statements:

Specified by:
execute in interface java.sql.Statement
Parameters:
sql - java.lang.String - the SQL to be executed
Returns:
boolean - true if there is a result set available
Throws:
java.sql.SQLException - raised for any errors encountered
See Also:
Statement.execute(String)

execute

public boolean execute(java.lang.String sql,
                       int autoGeneratedKeys)
                throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
execute in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.execute(String, int)

execute

public boolean execute(java.lang.String sql,
                       int[] columnIndexes)
                throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
execute in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.execute(String, int[])

execute

public boolean execute(java.lang.String sql,
                       java.lang.String[] columnNames)
                throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
execute in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.execute(String, String[])

executeBatch

public int[] executeBatch()
                   throws java.sql.SQLException
The Host Integrator Driver does not support batch operations.

Specified by:
executeBatch in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.executeBatch()

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String sql)
                                throws java.sql.SQLException
Executes a SQL SELECT query statement and return a ResultSet

Specified by:
executeQuery in interface java.sql.Statement
Parameters:
sql - java.lang.String - the SQL query to be executed
Returns:
java.sql.ResultSet - the results of the query execution
Throws:
java.sql.SQLException - raised if an error occurs
See Also:
Statement.executeQuery(String)

executeUpdate

public int executeUpdate(java.lang.String sql)
                  throws java.sql.SQLException
Executes an SQL UPDATE statement

Specified by:
executeUpdate in interface java.sql.Statement
Parameters:
sql - java.lang.String - the SQL update statement to be executed
Returns:
int - the number of rows updated by the sql statement execution. (NOTE: this method always returns 0 because the number of modified rows is unknown)
Throws:
java.sql.SQLException - raised if an error occurs
See Also:
Statement.executeUpdate(String)

executeUpdate

public int executeUpdate(java.lang.String sql,
                         int autoGeneratedKeys)
                  throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
executeUpdate in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.executeUpdate(String, int)

executeUpdate

public int executeUpdate(java.lang.String sql,
                         int[] columnIndexes)
                  throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
executeUpdate in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.executeUpdate(String, int[])

executeUpdate

public int executeUpdate(java.lang.String sql,
                         java.lang.String[] columnNames)
                  throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
executeUpdate in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.executeUpdate(String, String[])

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Gets the Connection object that produced this Statement object.

Specified by:
getConnection in interface java.sql.Statement
Throws:
java.sql.SQLException
See Also:
Statement.getConnection()

getFetchDirection

public int getFetchDirection()
                      throws java.sql.SQLException
Gets the fetch direction for this Statement object. This is intended to be a hint to the driver for improving performance. Host Integrator driver ignores this setting.

Specified by:
getFetchDirection in interface java.sql.Statement
Throws:
java.sql.SQLException
See Also:
Statement.getFetchDirection()

getFetchSize

public int getFetchSize()
                 throws java.sql.SQLException
Gets the fetch size for this Statement object. This is intended to be a hint to the driver for improving performance. In Host Integrator this simply limits the total number of rows returned from a query. Since Host Integrator cannot do partial fetches, there is no possibility of breaking a fetch into multiple 'fetchSize' chunks. This setting, then, determines the total maximum number of rows returned for any query. The default setting is zero, which means to fetch all available rows.

Specified by:
getFetchSize in interface java.sql.Statement
Throws:
java.sql.SQLException
See Also:
Statement.getFetchSize()

getGeneratedKeys

public java.sql.ResultSet getGeneratedKeys()
                                    throws java.sql.SQLException
Specified by:
getGeneratedKeys in interface java.sql.Statement
Throws:
java.sql.SQLException

getMaxFieldSize

public int getMaxFieldSize()
                    throws java.sql.SQLException
Gets the maximum number of bytes that a ResultSet column may contain

Specified by:
getMaxFieldSize in interface java.sql.Statement
Returns:
int - the maximum number of bytes for a ResultSet column. Zero indicates there is no limit
Throws:
java.sql.SQLException
See Also:
Statement.getMaxFieldSize()

getMaxRows

public int getMaxRows()
               throws java.sql.SQLException
Gets the maximum number of rows that a ResultSet object can contain

Specified by:
getMaxRows in interface java.sql.Statement
Returns:
int - the maximum number of rows for a ResultSet object. Zero indicates there is no limit
Throws:
java.sql.SQLException
See Also:
Statement.getMaxRows()

getMoreResults

public boolean getMoreResults()
                       throws java.sql.SQLException
Fetches the next part of data from Host Integrator server. Partial fetches are not supported by the Host Integrator driver, so this method always returns false.

Specified by:
getMoreResults in interface java.sql.Statement
Returns:
boolean - true if there are more results to fetch, false otherwise.
Throws:
java.sql.SQLException

getMoreResults

public boolean getMoreResults(int current)
                       throws java.sql.SQLException
Fetches the next part of data from Host Integrator server. Partial fetches are not supported by the Host Integrator driver, so this method always returns false.

Specified by:
getMoreResults in interface java.sql.Statement
Returns:
boolean - true if there are more results to fetch, false otherwise.
Throws:
java.sql.SQLException

getQueryTimeout

public int getQueryTimeout()
                    throws java.sql.SQLException
Gets the current queryTimeout value The queryTimeout limit is the number of seconds the driver will wait for a Statement object to execute. If the limit is exceeded, a SQLException is thrown.

Specified by:
getQueryTimeout in interface java.sql.Statement
Returns:
int - the current query timeout limit in seconds; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

getConnectionTimeout

public int getConnectionTimeout()
Gets the current connectionTimeout value The connectionTimeout limit is the number of seconds the driver will wait for a connection to complete.

Note: java.sql.Connection.createStatement returns java.sql.Statement. You must cast it to com.wrq.apptrieve.jdbc.ApptrieveStatement to use this method.

Returns:
int - the current connection timeout limit in seconds;

getResultSet

public java.sql.ResultSet getResultSet()
                                throws java.sql.SQLException
Obtains the current result set from a Statement object.

Specified by:
getResultSet in interface java.sql.Statement
Returns:
ResultSet - null if no result set is available, otherwise a result set
Throws:
java.sql.SQLException
See Also:
Statement.getResultSet()

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws java.sql.SQLException
Obtains the concurrency mode for ResultSet objects generated from queries that this Statement object executes. Host Integrator only supports read only ResultSets, so always returns ResultSet.CONCUR_READ_ONLY

Specified by:
getResultSetConcurrency in interface java.sql.Statement
Returns:
int - the concurrency setting for ResultSets
Throws:
java.sql.SQLException
See Also:
Statement.getResultSet()

getResultSetHoldability

public int getResultSetHoldability()
                            throws java.sql.SQLException
This method is not supported by the Host Integrator driver.

Specified by:
getResultSetHoldability in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.getResultSetHoldability()

getResultSetType

public int getResultSetType()
                     throws java.sql.SQLException
Obtains the type of ResultSet objects generated from queries that this Statement object executes. Host Integrator only supports nonscrollable ResultSets, so always returns ResultSet.TYPE_SCROLL_INSENSITIVE

Specified by:
getResultSetType in interface java.sql.Statement
Returns:
int - the type of ResultSets
Throws:
java.sql.SQLException
See Also:
Statement.getResultSet()

getUpdateCount

public int getUpdateCount()
                   throws java.sql.SQLException
Gets the number of rows affected by the most recently executed SQL statement.

Specified by:
getUpdateCount in interface java.sql.Statement
Returns:
int - the number of rows affected
Throws:
java.sql.SQLException
See Also:
Statement.getUpdateCount()

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Host Integrator JDBC driver does not support warnings.

Specified by:
getWarnings in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.getWarnings()

setCursorName

public void setCursorName(java.lang.String name)
                   throws java.sql.SQLException
Host Integrator JDBC driver does not support cursors.

Specified by:
setCursorName in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.setCursorName(String)

setEscapeProcessing

public void setEscapeProcessing(boolean enable)
                         throws java.sql.SQLException
Host Integrator JDBC driver does not support escape processing.

Specified by:
setEscapeProcessing in interface java.sql.Statement
Throws:
java.sql.SQLException - - always thrown.
See Also:
Statement.setEscapeProcessing(boolean)

setFetchDirection

public void setFetchDirection(int direction)
                       throws java.sql.SQLException
Sets the fetch direction for this Statement object. This is intended to be a hint to the driver for improving performance. Host Integrator driver ignores this setting.

Specified by:
setFetchDirection in interface java.sql.Statement
Throws:
java.sql.SQLException
See Also:
Statement.getFetchDirection()

setFetchSize

public void setFetchSize(int rows)
                  throws java.sql.SQLException
Sets the fetch size for this Statement object. This is intended to be a hint to the driver for improving performance. In Host Integrator this simply limits the total number of rows returned from a query. Since Host Integrator cannot do partial fetches, there is no possibility of breaking a fetch into multiple 'fetchSize' chunks. This setting, then determines the total maximum number of rows returned for any query. The default setting is zero, which means to fetch all available rows.

Specified by:
setFetchSize in interface java.sql.Statement
Parameters:
rows - int - the maximum number of rows to fetch
Throws:
java.sql.SQLException
See Also:
Statement.getFetchSize()

setMaxFieldSize

public void setMaxFieldSize(int max)
                     throws java.sql.SQLException
Sets the maximum length for a column in a ResultSet

Specified by:
setMaxFieldSize in interface java.sql.Statement
Parameters:
max - int - the maximum size for a column in a ResultSet
Throws:
java.sql.SQLException
See Also:
Statement.setMaxFieldSize(int)

setMaxRows

public void setMaxRows(int max)
                throws java.sql.SQLException
Sets the maximum number of rows in a ResultSet

Specified by:
setMaxRows in interface java.sql.Statement
Parameters:
max - int - the maximum number of rows in a ResultSet
Throws:
java.sql.SQLException
See Also:
Statement.setMaxRows(int)

setQueryTimeout

public void setQueryTimeout(int seconds)
                     throws java.sql.SQLException
Sets the current queryTimeout value The queryTimeout limit is the number of seconds the driver will wait for a Statement to execute. If the limit is exceeded, a SQLException is thrown.

Specified by:
setQueryTimeout in interface java.sql.Statement
Parameters:
seconds - int - the new query timeout limit in seconds; zero means unlimited
Throws:
java.sql.SQLException - if a database-access error occurs.

setConnectionTimeout

public void setConnectionTimeout(int seconds)
Sets the current connectionTimeout value The connectionTimeout limit is the number of seconds the driver will wait for a connection attempt to execute.

Note: java.sql.Connection.createStatement returns java.sql.Statement. You must cast it to com.wrq.apptrieve.jdbc.ApptrieveStatement to use this method.

Parameters:
seconds - int - the new query timeout limit in seconds;

isClosed

public boolean isClosed()
                 throws java.sql.SQLException
Specified by:
isClosed in interface java.sql.Statement
Throws:
java.sql.SQLException

setPoolable

public void setPoolable(boolean poolable)
                 throws java.sql.SQLException
Specified by:
setPoolable in interface java.sql.Statement
Throws:
java.sql.SQLException

isPoolable

public boolean isPoolable()
                   throws java.sql.SQLException
Specified by:
isPoolable in interface java.sql.Statement
Throws:
java.sql.SQLException

unwrap

public <T> T unwrap(java.lang.Class<T> iface)
         throws java.sql.SQLException
Specified by:
unwrap in interface java.sql.Wrapper
Throws:
java.sql.SQLException

isWrapperFor

public boolean isWrapperFor(java.lang.Class<?> iface)
                     throws java.sql.SQLException
Specified by:
isWrapperFor in interface java.sql.Wrapper
Throws:
java.sql.SQLException