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

Quick Search    Search Deep

org.jdaemon.test.sql
Class TestStatement  view TestStatement download TestStatement.java

java.lang.Object
  extended byorg.jdaemon.test.sql.TestStatement
All Implemented Interfaces:
java.sql.Statement

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

Statement object for test database connection Ultimately most operations simply cause output to be written to the parent collection's Log


Field Summary
(package private)  java.util.LinkedList batch
           
(package private)  TestConnection parent
           
 
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
TestStatement(TestConnection parent)
          Creates a new instance of TestStatement
 
Method Summary
 void addBatch(java.lang.String str)
          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 str)
          This method executes an arbitrary SQL statement of any time.
 boolean execute(java.lang.String str, int i)
           
 boolean execute(java.lang.String str, int[] i)
           
 boolean execute(java.lang.String str, java.lang.String[] strs)
           
 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 str)
          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 str)
          This method executes the specified SQL INSERT, UPDATE, or DELETE statement and returns the number of rows affected, which may be 0.
 int executeUpdate(java.lang.String str, int i)
           
 int executeUpdate(java.lang.String str, int[] i)
           
 int executeUpdate(java.lang.String str, java.lang.String[] strs)
           
 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.
 java.sql.ResultSet getGeneratedKeys()
           
 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
 boolean getMoreResults(int ind)
           
 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 getResultSetHoldability()
           
 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 str)
          This method sets the cursor name that will be used by the result set.
 void setEscapeProcessing(boolean param)
          This method sets the local escape processing mode on or off.
 void setFetchDirection(int param)
          This method informs the driver which direction the result set will be accessed in.
 void setFetchSize(int param)
          This method informs the driver how many rows it should fetch from the database at a time.
 void setMaxFieldSize(int param)
          This method sets the limit for the maximum length of any column in bytes.
 void setMaxRows(int param)
          This method sets the maximum number of rows that can be present in a result set.
 void setQueryTimeout(int param)
          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
 

Field Detail

parent

TestConnection parent

batch

java.util.LinkedList batch
Constructor Detail

TestStatement

public TestStatement(TestConnection parent)
Creates a new instance of TestStatement

Method Detail

getGeneratedKeys

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

executeUpdate

public int executeUpdate(java.lang.String str,
                         int i)
Specified by:
executeUpdate in interface java.sql.Statement

executeUpdate

public int executeUpdate(java.lang.String str,
                         int[] i)
Specified by:
executeUpdate in interface java.sql.Statement

executeUpdate

public int executeUpdate(java.lang.String str,
                         java.lang.String[] strs)
Specified by:
executeUpdate in interface java.sql.Statement

execute

public boolean execute(java.lang.String str,
                       int i)
Specified by:
execute in interface java.sql.Statement

execute

public boolean execute(java.lang.String str,
                       int[] i)
Specified by:
execute in interface java.sql.Statement

execute

public boolean execute(java.lang.String str,
                       java.lang.String[] strs)
Specified by:
execute in interface java.sql.Statement

getResultSetHoldability

public int getResultSetHoldability()
Specified by:
getResultSetHoldability in interface java.sql.Statement

addBatch

public void addBatch(java.lang.String str)
              throws java.sql.SQLException
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()
            throws java.sql.SQLException
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()
                throws java.sql.SQLException
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()
                   throws java.sql.SQLException
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

close

public void close()
           throws java.sql.SQLException
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

execute

public boolean execute(java.lang.String str)
                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()
                   throws java.sql.SQLException
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 str)
                                throws java.sql.SQLException
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 str)
                  throws java.sql.SQLException
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

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
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

getFetchDirection

public int getFetchDirection()
                      throws java.sql.SQLException
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()
                 throws java.sql.SQLException
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()
                    throws java.sql.SQLException
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()
               throws java.sql.SQLException
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()
                       throws java.sql.SQLException
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()
                    throws java.sql.SQLException
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()
                                throws java.sql.SQLException
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

getMoreResults

public boolean getMoreResults(int ind)
                       throws java.sql.SQLException
Specified by:
getMoreResults in interface java.sql.Statement

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws java.sql.SQLException
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()
                     throws java.sql.SQLException
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()
                   throws java.sql.SQLException
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()
                                throws java.sql.SQLException
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 str)
                   throws java.sql.SQLException
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 param)
                         throws java.sql.SQLException
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 param)
                       throws java.sql.SQLException
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 param)
                  throws java.sql.SQLException
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 param)
                     throws java.sql.SQLException
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 param)
                throws java.sql.SQLException
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 param)
                     throws java.sql.SQLException
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