com.stc.connector.appconn.db
Interface StatementAgent

All Known Subinterfaces:
CallableStatementAgent, PreparedStatementAgent, TableResultSet

public interface StatementAgent

Agent hosts a managed Statement object


Method Summary
 void cancel()
          Cancels statement results.
 void clearBatch()
          Clears the batch of operations.
 void clearWarnings()
          Clear all SQLWarning objects.
 int[] executeBatch()
          Executes a batch of SQL statements.
 int getFetchDirection()
          Returns result set fetch direction.
 int getFetchSize()
          Returns result set prefetch record count.
 int getMaxFieldSize()
          Gets the maximum data size for a column.
 int getMaxRows()
          Gets the maximum number of fetch records in a result set.
 boolean getMoreResults()
          Checks if there are more result set.
 int getQueryTimeout()
          Returns query timeout duration.
 ResultSetAgent getResultSet()
          Returns the result set of last executed statement.
 int getResultSetConcurrency()
          Returns result set concurrency mode.
 int getResultSetType()
          Returns result set scroll type.
 int getUpdateCount()
          Returns the records count of the last executed statement.
 java.sql.SQLWarning getWarnings()
          Gets the first SQLWarning that has been reported for this object.
 boolean isClosed()
          Returns the session open status.
 java.lang.String queryName()
          Retrieves the name of the listener.
 void setCursorName(java.lang.String sName)
          Sets result set cursor name.
 void setEscapeProcessing(boolean bEscape)
          Sets escape syntax processing mode.
 void setFetchDirection(int iDir)
          Sets result set fetch direction.
 void setFetchSize(int nSize)
          Sets result set prefetch record count.
 void setMaxFieldSize(int nSize)
          Sets maximum data size for a column.
 void setMaxRows(int nRow)
          Sets maximum number of fetch records.
 void setQueryTimeout(int nInterval)
          Sets query timeout duration.
 java.lang.Object stmtInvoke(java.lang.String methodName, java.lang.Class[] argsCls, java.lang.Object[] args)
          Invokes a method of the database Statement object of this ETD.
 

Method Detail

cancel

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

Parameters:
None.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

clearBatch

public void clearBatch()
                throws java.sql.SQLException
Clears the batch of operations.

Parameters:
None.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

clearWarnings

public void clearWarnings()
                   throws java.sql.SQLException
Clear all SQLWarning objects.

Parameters:
None.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

executeBatch

public int[] executeBatch()
                   throws java.sql.SQLException
Executes a batch of SQL statements.

Parameters:
None.
Returns:
an array of execution status of each command in the batch.
Throws:
java.sql.SQLException - when SQL problems occur.

getFetchDirection

public int getFetchDirection()
                      throws java.sql.SQLException
Returns result set fetch direction.

Parameters:
None.
Returns:
the fetch direction.
Throws:
java.sql.SQLException - when SQL problems occur.

getFetchSize

public int getFetchSize()
                 throws java.sql.SQLException
Returns result set prefetch record count.

Parameters:
None.
Returns:
number of rows to be fetched at a time
Throws:
java.sql.SQLException - when SQL problems occur.

getMaxFieldSize

public int getMaxFieldSize()
                    throws java.sql.SQLException
Gets the maximum data size for a column.

Parameters:
None.
Returns:
the maximum data size for a column.
Throws:
java.sql.SQLException - when SQL problems occur.

getMaxRows

public int getMaxRows()
               throws java.sql.SQLException
Gets the maximum number of fetch records in a result set.

Parameters:
None.
Returns:
the maximum number of fetch records.
Throws:
java.sql.SQLException - when SQL problems occur.

getMoreResults

public boolean getMoreResults()
                       throws java.sql.SQLException
Checks if there are more result set.

Parameters:
None.
Returns:
true if the next result is a result set.
Throws:
java.sql.SQLException - when SQL problems occur.

getQueryTimeout

public int getQueryTimeout()
                    throws java.sql.SQLException
Returns query timeout duration.

Parameters:
None.
Returns:
the query timeout limit in second.
Throws:
java.sql.SQLException - when SQL problems occur.

getResultSet

public ResultSetAgent getResultSet()
                            throws java.sql.SQLException
Returns the result set of last executed statement.

Parameters:
None.
Returns:
a ResultSetAgent instance which holds the result set.
Throws:
java.sql.SQLException - when SQL problems occur.

getResultSetConcurrency

public int getResultSetConcurrency()
                            throws java.sql.SQLException
Returns result set concurrency mode.

Parameters:
None.
Returns:
the result set concurrency mode. It can be either CONCUR_READ_ONLY or CONCUR_UPDATABLE.
Throws:
java.sql.SQLException - when SQL problems occur.

getResultSetType

public int getResultSetType()
                     throws java.sql.SQLException
Returns result set scroll type.

Parameters:
None.
Returns:
the result set type. It can be either TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE.
Throws:
java.sql.SQLException - when SQL problems occur.

getUpdateCount

public int getUpdateCount()
                   throws java.sql.SQLException
Returns the records count of the last executed statement.

Parameters:
None.
Returns:
the number of records affected by the update operation.
Throws:
java.sql.SQLException - when SQL problems occur.

getWarnings

public java.sql.SQLWarning getWarnings()
                                throws java.sql.SQLException
Gets the first SQLWarning that has been reported for this object.

Parameters:
None.
Returns:
SQL Warning
Throws:
java.sql.SQLException - when SQL problems occur. when SQL problems occur.

isClosed

public boolean isClosed()
Returns the session open status.

Parameters:
None.
Throws:
None.
Returns:
true if close() method has been called or connection has never established; false otherwise.

queryName

public java.lang.String queryName()
Retrieves the name of the listener.

Parameters:
None.
Throws:
None.
Returns:
the listener's class name.

setCursorName

public void setCursorName(java.lang.String sName)
                   throws java.sql.SQLException
Sets result set cursor name.

Parameters:
sName - a cursor name.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setEscapeProcessing

public void setEscapeProcessing(boolean bEscape)
                         throws java.sql.SQLException
Sets escape syntax processing mode. When enabled, the driver will scan for any escape syntax and do escape substitution before sending the escaped SQL statement to the database.

Parameters:
bEscape - true to enable escape scanning; false otherwise.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setFetchDirection

public void setFetchDirection(int iDir)
                       throws java.sql.SQLException
Sets result set fetch direction.

Parameters:
iDir - the fetch direction hint: FETCH_FORWARD, FETCH_REVERSE, or FETCH_UNKNOWN.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setFetchSize

public void setFetchSize(int nSize)
                  throws java.sql.SQLException
Sets result set prefetch record count.

Parameters:
nSize - number of rows to be fetched at a time
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setMaxFieldSize

public void setMaxFieldSize(int nSize)
                     throws java.sql.SQLException
Sets maximum data size for a column.

Parameters:
nSize - the maximum column size limit in bytes; zero means no limit.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setMaxRows

public void setMaxRows(int nRow)
                throws java.sql.SQLException
Sets maximum number of fetch records.

Parameters:
nRow - the maximum number of rows in a result set. zero means no limit.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setQueryTimeout

public void setQueryTimeout(int nInterval)
                     throws java.sql.SQLException
Sets query timeout duration.

Parameters:
nInterval - the query timeout limit in second.
Returns:
the query timeout limit in second.
Throws:
java.sql.SQLException - when SQL problems occur.

stmtInvoke

public java.lang.Object stmtInvoke(java.lang.String methodName,
                                   java.lang.Class[] argsCls,
                                   java.lang.Object[] args)
                            throws java.lang.Exception
Invokes a method of the database Statement object of this ETD.

Parameters:
methodName - the name of the method
argsCls - Class array for types of formal arguments for method, in the declared order. Can be null if there are no formal arguments. However, cannot invoke constructor here.
args - Object array of formal arguments for method in the declared order. Can be null if there are no formal arguments. However, cannot invoke constructor here.
Returns:
the Object instance resulting from the method invocation. Can be null if nothing is returned (void return declaration).
Throws:
java.lang.Exception - whatever exception the invoked method throws.


Copyright 2004 by SeeBeyond Technology Corporation. All Rights Reserved.