Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mockobjects.eziba.sql
Class Statement  view Statement download Statement.java

java.lang.Object
  extended bycom.mockobjects.eziba.sql.Statement
All Implemented Interfaces:
java.sql.Statement
Direct Known Subclasses:
PreparedStatement

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


Field Summary
protected  Connection connection
           
protected  java.lang.String sql
           
 
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
 
Constructor Summary
(package private) Statement(Connection p_connection, java.lang.String p_sql)
           
 
Method Summary
 void addBatch(java.lang.String sql)
          This method adds a SQL statement to a SQL batch.
 void cancel()
          This method cancels an outstanding statement, if the database supports that operation.
 void clearBatch()
          This method clears out any SQL statements that have been populated in the current batch.
 void clearWarnings()
          This method clears any SQL warnings that have been attached to this statement.
 void close()
          This method closes the statement and frees any associated resources.
 boolean execute(java.lang.String sql)
          This method executes an arbitrary SQL statement of any time.
 int[] executeBatch()
          This method executes the SQL batch and returns an array of update counts - one for each SQL statement in the batch - ordered in the same order the statements were added to the batch.
 java.sql.ResultSet executeQuery(java.lang.String sql)
          This method executes the specified SQL SELECT statement and returns a (possibly empty) ResultSet with the results of the query.
 int executeUpdate(java.lang.String sql)
          This method executes the specified SQL INSERT, UPDATE, or DELETE statement and returns the number of rows affected, which may be 0.
 java.sql.Connection getConnection()
          This method returns the Connection instance that was used to create this object.
 int getFetchDirection()
          This method returns the current direction that the driver thinks the result set will be accessed int.
 int getFetchSize()
          This method returns the number of rows the driver believes should be fetched from the database at a time.
 int getMaxFieldSize()
          This method returns the maximum length of any column value in bytes.
 int getMaxRows()
          This method returns the maximum possible number of rows in a result set.
 boolean getMoreResults()
          This method advances the result set pointer to the next result set, which can then be retrieved using getResultSet
 int getQueryTimeout()
          The method returns the number of seconds a statement may be in process before timing out.
 java.sql.ResultSet getResultSet()
          This method returns the result set of the SQL statement that was executed.
 int getResultSetConcurrency()
          This method returns the concurrency type of the result set for this statement.
 int getResultSetType()
          This method returns the result set type for this statement.
 int getUpdateCount()
          This method returns the update count of the SQL statement that was executed.
 java.sql.SQLWarning getWarnings()
          This method returns the first SQL warning attached to this statement.
 void setCursorName(java.lang.String name)
          This method sets the cursor name that will be used by the result set.
 void setEscapeProcessing(boolean enable)
          This method sets the local escape processing mode on or off.
 void setFetchDirection(int direction)
          This method informs the driver which direction the result set will be accessed in.
 void setFetchSize(int rows)
          This method informs the driver how many rows it should fetch from the database at a time.
 void setMaxFieldSize(int max)
          This method sets the limit for the maximum length of any column in bytes.
 void setMaxRows(int max)
          This method sets the maximum number of rows that can be present in a result set.
 void setQueryTimeout(int seconds)
          This method sets the number of seconds a statement may be in process before timing out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Statement
execute, execute, execute, executeUpdate, executeUpdate, executeUpdate, getGeneratedKeys, getMoreResults, getResultSetHoldability
 

Field Detail

connection

protected final Connection connection

sql

protected final java.lang.String sql
Constructor Detail

Statement

Statement(Connection p_connection,
          java.lang.String p_sql)
Method Detail

close

public void close()
Description copied from interface: java.sql.Statement
This method closes the statement and frees any associated resources.

Specified by:
close in interface java.sql.Statement

getConnection

public java.sql.Connection getConnection()
Description copied from interface: java.sql.Statement
This method returns the Connection instance that was used to create this object.

Specified by:
getConnection in interface java.sql.Statement

addBatch

public void addBatch(java.lang.String sql)
Description copied from interface: java.sql.Statement
This method adds a SQL statement to a SQL batch. A driver is not required to implement this method.

Specified by:
addBatch in interface java.sql.Statement

cancel

public void cancel()
Description copied from interface: java.sql.Statement
This method cancels an outstanding statement, if the database supports that operation.

Specified by:
cancel in interface java.sql.Statement

clearBatch

public void clearBatch()
Description copied from interface: java.sql.Statement
This method clears out any SQL statements that have been populated in the current batch. A driver is not required to implement this method.

Specified by:
clearBatch in interface java.sql.Statement

clearWarnings

public void clearWarnings()
Description copied from interface: java.sql.Statement
This method clears any SQL warnings that have been attached to this statement.

Specified by:
clearWarnings in interface java.sql.Statement

execute

public boolean execute(java.lang.String sql)
                throws java.sql.SQLException
Description copied from interface: java.sql.Statement
This method executes an arbitrary SQL statement of any time. The methods getResultSet, getMoreResults and getUpdateCount retrieve the results.

Specified by:
execute in interface java.sql.Statement

executeBatch

public int[] executeBatch()
Description copied from interface: java.sql.Statement
This method executes the SQL batch and returns an array of update counts - one for each SQL statement in the batch - ordered in the same order the statements were added to the batch. A driver is not required to implement this method.

Specified by:
executeBatch in interface java.sql.Statement

executeQuery

public java.sql.ResultSet executeQuery(java.lang.String sql)
Description copied from interface: java.sql.Statement
This method executes the specified SQL SELECT statement and returns a (possibly empty) ResultSet with the results of the query.

Specified by:
executeQuery in interface java.sql.Statement

executeUpdate

public int executeUpdate(java.lang.String sql)
Description copied from interface: java.sql.Statement
This method executes the specified SQL INSERT, UPDATE, or DELETE statement and returns the number of rows affected, which may be 0.

Specified by:
executeUpdate in interface java.sql.Statement

getFetchDirection

public int getFetchDirection()
Description copied from interface: java.sql.Statement
This method returns the current direction that the driver thinks the result set will be accessed int.

Specified by:
getFetchDirection in interface java.sql.Statement

getFetchSize

public int getFetchSize()
Description copied from interface: java.sql.Statement
This method returns the number of rows the driver believes should be fetched from the database at a time.

Specified by:
getFetchSize in interface java.sql.Statement

getMaxFieldSize

public int getMaxFieldSize()
Description copied from interface: java.sql.Statement
This method returns the maximum length of any column value in bytes.

Specified by:
getMaxFieldSize in interface java.sql.Statement

getMaxRows

public int getMaxRows()
Description copied from interface: java.sql.Statement
This method returns the maximum possible number of rows in a result set.

Specified by:
getMaxRows in interface java.sql.Statement

getMoreResults

public boolean getMoreResults()
Description copied from interface: java.sql.Statement
This method advances the result set pointer to the next result set, which can then be retrieved using getResultSet

Specified by:
getMoreResults in interface java.sql.Statement

getQueryTimeout

public int getQueryTimeout()
Description copied from interface: java.sql.Statement
The method returns the number of seconds a statement may be in process before timing out. A value of 0 means there is no timeout.

Specified by:
getQueryTimeout in interface java.sql.Statement

getResultSet

public java.sql.ResultSet getResultSet()
Description copied from interface: java.sql.Statement
This method returns the result set of the SQL statement that was executed. This should be called only once per result set returned.

Specified by:
getResultSet in interface java.sql.Statement

getResultSetConcurrency

public int getResultSetConcurrency()
Description copied from interface: java.sql.Statement
This method returns the concurrency type of the result set for this statement. This will be one of the concurrency types defined in ResultSet.

Specified by:
getResultSetConcurrency in interface java.sql.Statement

getResultSetType

public int getResultSetType()
Description copied from interface: java.sql.Statement
This method returns the result set type for this statement. This will be one of the result set types defined in ResultSet.

Specified by:
getResultSetType in interface java.sql.Statement

getUpdateCount

public int getUpdateCount()
Description copied from interface: java.sql.Statement
This method returns the update count of the SQL statement that was executed. This should be called only once per executed SQL statement.

Specified by:
getUpdateCount in interface java.sql.Statement

getWarnings

public java.sql.SQLWarning getWarnings()
Description copied from interface: java.sql.Statement
This method returns the first SQL warning attached to this statement. Subsequent warnings will be chained to this one.

Specified by:
getWarnings in interface java.sql.Statement

setCursorName

public void setCursorName(java.lang.String name)
Description copied from interface: java.sql.Statement
This method sets the cursor name that will be used by the result set.

Specified by:
setCursorName in interface java.sql.Statement

setEscapeProcessing

public void setEscapeProcessing(boolean enable)
Description copied from interface: java.sql.Statement
This method sets the local escape processing mode on or off. The default value is on.

Specified by:
setEscapeProcessing in interface java.sql.Statement

setFetchDirection

public void setFetchDirection(int direction)
Description copied from interface: java.sql.Statement
This method informs the driver which direction the result set will be accessed in.

Specified by:
setFetchDirection in interface java.sql.Statement

setFetchSize

public void setFetchSize(int rows)
Description copied from interface: java.sql.Statement
This method informs the driver how many rows it should fetch from the database at a time.

Specified by:
setFetchSize in interface java.sql.Statement

setMaxFieldSize

public void setMaxFieldSize(int max)
Description copied from interface: java.sql.Statement
This method sets the limit for the maximum length of any column in bytes.

Specified by:
setMaxFieldSize in interface java.sql.Statement

setMaxRows

public void setMaxRows(int max)
Description copied from interface: java.sql.Statement
This method sets the maximum number of rows that can be present in a result set.

Specified by:
setMaxRows in interface java.sql.Statement

setQueryTimeout

public void setQueryTimeout(int seconds)
Description copied from interface: java.sql.Statement
This method sets the number of seconds a statement may be in process before timing out. A value of 0 means there is no timeout.

Specified by:
setQueryTimeout in interface java.sql.Statement