com.northgateis.reality.realsql
Class RealSQLStatement

java.lang.Object
 |
 +--com.northgateis.reality.realsql.RealSQLStatement
Direct Known Subclasses:
RealSQLPreparedStatement

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

The RealSQLStatement class is an implementation of the JDBC 2.0 Statement interface.

See Also:
Connection.createStatement()

Method Summary
 void addBatch(java.lang.String sql)
          Not supported by the RealSQL-JDBC driver.
protected  void addResultSet(RealSQLResultSet rs)
           
 void cancel()
          Cancels currently executing statement.
 void clearBatch()
          Not supported by the RealSQL-JDBC driver.
 void clearWarnings()
          Clears all the warnings reported on this Statement object.
 void close()
          Closes the statement and any associated ResultSet.
protected  void completeLoad()
           
 boolean execute(java.lang.String sql)
          Executes a SQL statement that may return multiple results.
 int[] executeBatch()
          Not supported by the RealSQL-JDBC driver.
protected  java.sql.ResultSet executeCatalogQuery(java.lang.String sql)
           
protected  boolean executeCommon(RealSQLResultSetMetaData rsmd)
           
 java.sql.ResultSet executeQuery(java.lang.String sql)
          Executes a SQL statement that returns a single ResultSet.
protected  java.sql.ResultSet executeQueryCommon(RealSQLResultSetMetaData rsmd)
           
protected  RealSQLResultSet executeStmt(RealSQLResultSetMetaData rsmd)
           
 int executeUpdate(java.lang.String sql)
          Executes an SQL INSERT, UPDATE or DELETE statement.
protected  int executeUpdateCommon(RealSQLResultSetMetaData rsmd)
           
 java.sql.Connection getConnection()
          JDBC 2.0 Returns the Connection object that produced this Statement object.
 int getFetchDirection()
          JDBC 2.0 Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.
 int getFetchSize()
          JDBC 2.0 Retrieves the number of result set rows that is the default fetch size for result sets generated from this Statement object.
 int getMaxFieldSize()
          Returns the maximum number of bytes allowed for any column value.
 int getMaxRows()
          Retrieves the maximum number of rows that a ResultSet can contain.
 boolean getMoreResults()
          Moves to a Statement's next result.
 int getQueryTimeout()
          Retrieves the number of seconds the driver will wait for a Statement to execute.
 java.sql.ResultSet getResultSet()
          Returns the current result as a ResultSet object.
 int getResultSetConcurrency()
          JDBC 2.0 result set concurrency.
 int getResultSetType()
          JDBC 2.0 Determine the result set type.
 int getUpdateCount()
          Returns the current result as an update count.
 java.sql.SQLWarning getWarnings()
          Retrieves the first warning reported by calls on this Statement.
protected  boolean isCatalogQuery()
           
protected  java.sql.SQLException methodNotSupported()
           
protected  RealSQLResultSetMetaData prepareStmt(java.lang.String sql)
           
protected  void reset()
           
 void setCursorName(java.lang.String unused)
          Not supported by the RealSQL-JDBC driver.
 void setEscapeProcessing(boolean enable)
          Not supported by the RealSQL-JDBC driver.
 void setFetchDirection(int dir)
          JDBC 2.0 Gives the driver a hint as to the direction in which the rows in a result set will be processed.
 void setFetchSize(int unused)
          Not supported by the RealSQL-JDBC driver.
 void setMaxFieldSize(int max)
          Not supported by the RealSQL-JDBC driver.
 void setMaxRows(int max)
          Not supported by the RealSQL-JDBC driver.
 void setQueryTimeout(int unused)
          Not supported by the RealSQL-JDBC driver.
 
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
Not supported by the RealSQL-JDBC driver.

JDBC 2.0 Adds a SQL command to the current batch of commmands for the statement.

Specified by:
addBatch in interface java.sql.Statement
Parameters:
sql - the SQL statement to be added to the batch
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


cancel

public void cancel()
 throws java.sql.SQLException
Cancels currently executing statement.

Specified by:
cancel in interface java.sql.Statement
Throws:
java.sql.SQLException - this is never thrown


clearBatch

public void clearBatch()
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

JDBC 2.0 Makes the set of commands in the current batch empty.

Specified by:
clearBatch in interface java.sql.Statement
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


clearWarnings

public void clearWarnings()
 throws java.sql.SQLException
Clears all the warnings reported on this Statement object.

Specified by:
clearWarnings in interface java.sql.Statement
Throws:
java.sql.SQLException - this is never thrown


close

public void close()
 throws java.sql.SQLException
Closes the statement and any associated ResultSet.

Specified by:
close in interface java.sql.Statement
Throws:
java.sql.SQLException - never thrown.


execute

public boolean execute(java.lang.String sql)
 throws java.sql.SQLException
Executes a SQL statement that may return multiple results.

Specified by:
execute in interface java.sql.Statement
Parameters:
sql - the SQL to be sent to the database
Returns:
true if the SQL produced a result set
Throws:
java.sql.SQLException - an error occurred talking to the database.


executeCommon

protected boolean executeCommon(RealSQLResultSetMetaData rsmd)
 throws java.sql.SQLException

executeBatch

public int[] executeBatch()
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

JDBC 2.0 Submits a batch of commands to the database for execution.

Specified by:
executeBatch in interface java.sql.Statement
Returns:
an array of update counts for each batch.
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


executeQuery

public java.sql.ResultSet executeQuery(java.lang.String sql)
 throws java.sql.SQLException
Executes a SQL statement that returns a single ResultSet.

Specified by:
executeQuery in interface java.sql.Statement
Parameters:
sql - the SQL to send to the database.
Returns:
a ResultSet matching the query.
Throws:
java.sql.SQLException - an error occurred talking to the database.


executeQueryCommon

protected java.sql.ResultSet executeQueryCommon(RealSQLResultSetMetaData rsmd)
 throws java.sql.SQLException

executeUpdate

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

Specified by:
executeUpdate in interface java.sql.Statement
Parameters:
sql - the UPDATE SQL.
Returns:
the numberof affected rows.
Throws:
java.sql.SQLException - an error occurred talking to the database


executeUpdateCommon

protected int executeUpdateCommon(RealSQLResultSetMetaData rsmd)
 throws java.sql.SQLException

getConnection

public java.sql.Connection getConnection()
JDBC 2.0 Returns the Connection object that produced this Statement object.

Specified by:
getConnection in interface java.sql.Statement
Returns:
the RealSQLConnection that owns this Statement


getFetchDirection

public int getFetchDirection()
 throws java.sql.SQLException
JDBC 2.0 Retrieves the direction for fetching rows from database tables that is the default for result sets generated from this Statement object.

Specified by:
getFetchDirection in interface java.sql.Statement
Returns:
the direction in which results might be fetched.
Throws:
java.sql.SQLException - never thrown.


getFetchSize

public int getFetchSize()
 throws java.sql.SQLException
JDBC 2.0 Retrieves the number of result set rows that is the default fetch size for result sets generated from this Statement object. RealSQL-JDBC driver always fetches all rows.

Specified by:
getFetchSize in interface java.sql.Statement
Returns:
0
Throws:
java.sql.SQLException - never thrown.


getMaxFieldSize

public int getMaxFieldSize()
 throws java.sql.SQLException
Returns the maximum number of bytes allowed for any column value.

Specified by:
getMaxFieldSize in interface java.sql.Statement
Returns:
the current max column size limit; zero means unlimited
Throws:
java.sql.SQLException - never thrown.


getMaxRows

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

Specified by:
getMaxRows in interface java.sql.Statement
Returns:
the current max row limit; zero means unlimited.
Throws:
java.sql.SQLException - this is never thrown.


getMoreResults

public boolean getMoreResults()
 throws java.sql.SQLException
Moves to a Statement's next result.

Specified by:
getMoreResults in interface java.sql.Statement
Returns:
true if there are more results to process
Throws:
java.sql.SQLException - this will not be thrown


getQueryTimeout

public int getQueryTimeout()
 throws java.sql.SQLException
Retrieves the number of seconds the driver will wait for a Statement to execute. The query timeout is the number of seconds a statement should wait before aborting the execution of a statement. If the limit is encountered, processing ends and an exception is thrown.

Specified by:
getQueryTimeout in interface java.sql.Statement
Returns:
the query timeout
Throws:
java.sql.SQLException - this is never thrown


getResultSet

public java.sql.ResultSet getResultSet()
 throws java.sql.SQLException
Returns the current result as a ResultSet object.

Specified by:
getResultSet in interface java.sql.Statement
Returns:
a result set matching the most recent query.
Throws:
java.sql.SQLException. -  


getResultSetConcurrency

public int getResultSetConcurrency()
 throws java.sql.SQLException
JDBC 2.0 result set concurrency. This determines whether or not a result set generated by this statement can be updated in place.

Specified by:
getResultSetConcurrency in interface java.sql.Statement
Returns:
the result set concurrency
Throws:
java.sql.SQLException - this is never thrown


getResultSetType

public int getResultSetType()
 throws java.sql.SQLException
JDBC 2.0 Determine the result set type.

Specified by:
getResultSetType in interface java.sql.Statement
Returns:
the result set type
Throws:
java.sql.SQLException - this is never actually thrown


getUpdateCount

public int getUpdateCount()
 throws java.sql.SQLException
Returns the current result as an update count.

If the result is a ResultSet or there are no more results, -1 is returned.

Specified by:
getUpdateCount in interface java.sql.Statement
Returns:
the number of rows affected by the last executed update statement.


getWarnings

public final java.sql.SQLWarning getWarnings()
 throws java.sql.SQLException
Retrieves the first warning reported by calls on this Statement.

Specified by:
getWarnings in interface java.sql.Statement
Returns:
the first SQLWarning or null.
Throws:
java.sql.SQLException - this is never thrown.


setQueryTimeout

public void setQueryTimeout(int unused)
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

Sets the number of seconds the driver will wait for a Statement to execute to the given number of seconds.

Specified by:
setQueryTimeout in interface java.sql.Statement
Parameters:
unused - the number of seconds the Statement should wait
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


setCursorName

public void setCursorName(java.lang.String unused)
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

Defines the SQL cursor name that will be used by subsequent Statement execute methods.

Specified by:
setCursorName in interface java.sql.Statement
Parameters:
unused - the name of the cursor
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


setEscapeProcessing

public void setEscapeProcessing(boolean enable)
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

Sets escape processing on or off.

Specified by:
setEscapeProcessing in interface java.sql.Statement
Parameters:
enable - indicate whether to enable or disable escape processing
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


setFetchDirection

public void setFetchDirection(int dir)
 throws java.sql.SQLException
JDBC 2.0 Gives the driver a hint as to the direction in which the rows in a result set will be processed.

Reality only supports FETCH_FORWARD.

Specified by:
setFetchDirection in interface java.sql.Statement
Parameters:
dir - the direction
Throws:
java.sql.SQLException - if dir is not FETCH_FORWARD.


setFetchSize

public void setFetchSize(int unused)
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

JDBC 2.0 Gives the JDBC driver a hint as to the number of rows that should be fetched from the database when more rows are needed.

Specified by:
setFetchSize in interface java.sql.Statement
Parameters:
unused - the suggested fetch size
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


setMaxFieldSize

public void setMaxFieldSize(int max)
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

Sets the limit for the maximum number of bytes in a column to the given number of bytes.

Specified by:
setMaxFieldSize in interface java.sql.Statement
Parameters:
max - the maximum field size
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function".


setMaxRows

public void setMaxRows(int max)
 throws java.sql.SQLException
Not supported by the RealSQL-JDBC driver.

Sets the limit for the maximum number of rows that any ResultSet can contain to the given number.

Specified by:
setMaxRows in interface java.sql.Statement
Parameters:
max - the maximum number of rows
Throws:
java.sql.SQLException - IM001 - "Driver does not support this function"


completeLoad

protected void completeLoad()

reset

protected void reset()
 throws java.sql.SQLException

executeCatalogQuery

protected java.sql.ResultSet executeCatalogQuery(java.lang.String sql)
 throws java.sql.SQLException

isCatalogQuery

protected boolean isCatalogQuery()

prepareStmt

protected RealSQLResultSetMetaDataprepareStmt(java.lang.String sql)
 throws java.sql.SQLException

executeStmt

protected RealSQLResultSetexecuteStmt(RealSQLResultSetMetaData rsmd)
 throws java.sql.SQLException

addResultSet

protected void addResultSet(RealSQLResultSet rs)

methodNotSupported

protected java.sql.SQLException methodNotSupported()