com.stc.connector.appconn.db
Interface PreparedStatementAgent

All Superinterfaces:
StatementAgent
All Known Subinterfaces:
CallableStatementAgent

public interface PreparedStatementAgent
extends StatementAgent

Agent hosts PreparedStatement interface.


Method Summary
 void addBatch()
          Adds a set of parameters to the list of commands to be sent as a batch.
 void clearParameters()
          Clears the value of all parameters.
 void enableResultSetsAndUpdateCounts()
          Enables both Result Sets and Update Counts to be received after an execute call.
 void enableResultSetsOnly()
          Enables only Result Sets to be received after an execute call.
 void enableUpdateCountsOnly()
          Enables only Update Counts to be received after an execute call.
 boolean execute()
          Executes the prepared SQL statement.
 ResultSetAgent executeQuery()
          Executes the prepared SQL query and returns a ResultSetAgent that contains the generated result set.
 int executeUpdate()
          Executes the prepared SQL statement and returns the number of rows that were affected.
 java.lang.String getPreparedStmt()
          Returns the Prepared Statement.
 PreparedStatementResultSet[] getRSAgentList()
          Gets the PreparedStatementResultSet list.
 java.lang.String[] getRSAgentSigs()
          Gets ResultSetAgent signatures.
 int getUpdateCount()
          Returns the record count of the last executed statement.
 boolean matchResultSetSignature(int ord)
          Matches a particular Result Set's Column signature with the current one and points the current Result Set Agent to it.
 boolean resultsAvailable()
          Determines whether results (Update Counts and/or Result Sets) are available after an execute.
 void setArray(int index, java.sql.Array a)
          Sets the Array value of the indexed parameter.
 void setAsciiStream(int index, java.io.InputStream is, int length)
          Sets the character value of the indexed parameter with an input stream and specified length.
 void setBigDecimal(int index, java.math.BigDecimal dec)
          Sets the decimal value of indexed parameter.
 void setBinaryStream(int index, java.io.InputStream is, int length)
          Sets the binary value of the indexed parameter with an input stream and specified length.
 void setBlob(int index, java.sql.Blob blob)
          Sets the Blob value of the indexed parameter.
 void setBoolean(int index, boolean b)
          Sets the boolean value of indexed parameter.
 void setByte(int index, byte byt)
          Sets the byte value of indexed parameter.
 void setBytes(int index, byte[] bytes)
          Sets the byte array value of the indexed parameter.
 void setCharacterStream(int index, java.io.Reader rd, int length)
          Sets the character value of the indexed parameter with a reader stream and specified length.
 void setClob(int index, java.sql.Clob clob)
          Sets the Clob value of the indexed parameter.
 void setDate(int index, java.sql.Date date)
          Sets the date value of indexed parameter.
 void setDate(int index, java.sql.Date date, java.util.Calendar cal)
          Sets the date value of indexed parameter including the time zone from the calendar.
 void setDouble(int index, double d)
          Sets the double value of indexed parameter.
 void setFloat(int index, float f)
          Sets the float value of indexed parameter.
 void setInt(int index, int i)
          Sets the integer value of indexed parameter.
 void setLong(int index, long l)
          Sets the long value of indexed parameter.
 void setNull(int index, int type)
          Nullifies value of the indexed parameter.
 void setNull(int index, int type, java.lang.String tname)
          Nullifies value of indexed parameter.
 void setObject(int index, java.lang.Object ob)
          Sets value of indexed parameter with an object.
 void setObject(int index, java.lang.Object ob, int iType)
          Sets value of indexed parameter with data type conversion.
 void setObject(int index, java.lang.Object ob, int iType, int iScale)
          Sets value of indexed parameter with data type conversion and specified scale.
 void setRef(int index, java.sql.Ref ref)
          Sets the Ref value of the indexed parameter.
 void setRSAgentList(PreparedStatementResultSet[] rsAgentList)
          Sets PreparedStatementResultSet list and holds the list of result sets returned from the prepared statement.
 void setRSAgentSigs(java.lang.String[] rsAgentSigs)
          Sets ResultSetAgent signatures.
 void setShort(int index, short si)
          Sets the short value of indexed parameter.
 void setString(int index, java.lang.String s)
          Sets the string value of the indexed parameter.
 void setTime(int index, java.sql.Time t)
          Sets the time value of indexed parameter.
 void setTime(int index, java.sql.Time t, java.util.Calendar cal)
          Sets the time value of indexed parameter with time zone from calendar.
 void setTimestamp(int index, java.sql.Timestamp ts)
          Sets the timestamp value of the indexed parameter.
 void setTimestamp(int index, java.sql.Timestamp ts, java.util.Calendar cal)
          Sets the timestamp value of the indexed parameter including the time zone from the calendar.
 
Methods inherited from interface com.stc.connector.appconn.db.StatementAgent
cancel, clearBatch, clearWarnings, executeBatch, getFetchDirection, getFetchSize, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetType, getWarnings, isClosed, queryName, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setMaxFieldSize, setMaxRows, setQueryTimeout, stmtInvoke
 

Method Detail

addBatch

public void addBatch()
              throws java.sql.SQLException
Adds a set of parameters to the list of commands to be sent as a batch.

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

clearParameters

public void clearParameters()
                     throws java.sql.SQLException
Clears the value of all parameters.

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

enableResultSetsAndUpdateCounts

public void enableResultSetsAndUpdateCounts()
Enables both Result Sets and Update Counts to be received after an execute call. This is the default.

Parameters:
None.
Returns:
void - None.
Throws:
None.

enableResultSetsOnly

public void enableResultSetsOnly()
Enables only Result Sets to be received after an execute call.

Parameters:
None.
Returns:
void - None.
Throws:
None.

enableUpdateCountsOnly

public void enableUpdateCountsOnly()
Enables only Update Counts to be received after an execute call.

Parameters:
None.
Returns:
void - None.
Throws:
None.

execute

public boolean execute()
                throws java.sql.SQLException
Executes the prepared SQL statement.

Parameters:
None.
Returns:
true if the first result is a result set; false if it is an update count or there is no result.
Throws:
java.sql.SQLException - when SQL problems occur.

executeQuery

public ResultSetAgent executeQuery()
                            throws java.sql.SQLException
Executes the prepared SQL query and returns a ResultSetAgent that contains the generated result set.

Parameters:
None.
Returns:
a ResultSetAgent which holds the return records.
Throws:
java.sql.SQLException - when SQL problems occur.

executeUpdate

public int executeUpdate()
                  throws java.sql.SQLException
Executes the prepared SQL statement and returns the number of rows that were affected.

Parameters:
None.
Returns:
the number of affected rows. 0 if no rows are affected or a DDL statement was executed.
Throws:
java.sql.SQLException - when SQL problems occur.

getPreparedStmt

public java.lang.String getPreparedStmt()
                                 throws java.sql.SQLException
Returns the Prepared Statement.

Parameters:
None.
Returns:
the SQL prepared statement.
Throws:
java.sql.SQLException - when SQL problems occur.

getRSAgentList

public PreparedStatementResultSet[] getRSAgentList()
Gets the PreparedStatementResultSet list.

Parameters:
None.
Returns:
rsAgentList an array of PreparedStatementResultSet instances.
Throws:
None.

getRSAgentSigs

public java.lang.String[] getRSAgentSigs()
Gets ResultSetAgent signatures.

Parameters:
None.
Returns:
an array of signatures in string.
Throws:
None.

getUpdateCount

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

Parameters:
None.
Specified by:
getUpdateCount in interface StatementAgent
Returns:
the number of updated records.
Throws:
java.sql.SQLException - when SQL problems occur.

matchResultSetSignature

public boolean matchResultSetSignature(int ord)
                                throws java.sql.SQLException
Matches a particular Result Set's Column signature with the current one and points the current Result Set Agent to it.

Parameters:
ord - the ordinal position of the particular Result Set.
Returns:
true if the Result Set signature matches; false otherwise.
Throws:
java.sql.SQLException - when SQL problems occur. when SQL problems occur.

resultsAvailable

public boolean resultsAvailable()
                         throws java.sql.SQLException
Determines whether results (Update Counts and/or Result Sets) are available after an execute.

Parameters:
None.
Returns:
true if Update Counts and/or Result Sets are available.
Throws:
java.sql.SQLException - when SQL problems occur. when SQL problems occur.

setArray

public void setArray(int index,
                     java.sql.Array a)
              throws java.sql.SQLException
Sets the Array value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
a - an Array parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setAsciiStream

public void setAsciiStream(int index,
                           java.io.InputStream is,
                           int length)
                    throws java.sql.SQLException
Sets the character value of the indexed parameter with an input stream and specified length.

Parameters:
index - the position of the parameter. It starts from 1.
is - an ASCII stream parameter value.
length - the number of bytes to be read from the stream.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setBigDecimal

public void setBigDecimal(int index,
                          java.math.BigDecimal dec)
                   throws java.sql.SQLException
Sets the decimal value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
dec - a BigDecimal parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setBinaryStream

public void setBinaryStream(int index,
                            java.io.InputStream is,
                            int length)
                     throws java.sql.SQLException
Sets the binary value of the indexed parameter with an input stream and specified length.

Parameters:
index - the position of the parameter. It starts from 1.
is - an Binary stream parameter value.
length - the number of bytes to be read from the stream.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setBlob

public void setBlob(int index,
                    java.sql.Blob blob)
             throws java.sql.SQLException
Sets the Blob value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
blob - a Blob parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setBoolean

public void setBoolean(int index,
                       boolean b)
                throws java.sql.SQLException
Sets the boolean value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
b - a boolean parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setByte

public void setByte(int index,
                    byte byt)
             throws java.sql.SQLException
Sets the byte value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
byt - a byte parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setBytes

public void setBytes(int index,
                     byte[] bytes)
              throws java.sql.SQLException
Sets the byte array value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
bytes - a byte array parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setCharacterStream

public void setCharacterStream(int index,
                               java.io.Reader rd,
                               int length)
                        throws java.sql.SQLException
Sets the character value of the indexed parameter with a reader stream and specified length.

Parameters:
index - the position of the parameter. It starts from 1.
rd - a Reader parameter value.
length - the number of characters to be read from the stream.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setClob

public void setClob(int index,
                    java.sql.Clob clob)
             throws java.sql.SQLException
Sets the Clob value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
clob - a Clob parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setDate

public void setDate(int index,
                    java.sql.Date date)
             throws java.sql.SQLException
Sets the date value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
date - a Date parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setDate

public void setDate(int index,
                    java.sql.Date date,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Sets the date value of indexed parameter including the time zone from the calendar.

Parameters:
index - the position of the parameter. It starts from 1.
date - a Date parameter value.
cal - the Calendar object used to construct the Date object
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setDouble

public void setDouble(int index,
                      double d)
               throws java.sql.SQLException
Sets the double value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
d - a double parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setFloat

public void setFloat(int index,
                     float f)
              throws java.sql.SQLException
Sets the float value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
f - a float parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setInt

public void setInt(int index,
                   int i)
            throws java.sql.SQLException
Sets the integer value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
i - an integer parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setLong

public void setLong(int index,
                    long l)
             throws java.sql.SQLException
Sets the long value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
l - a long parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setNull

public void setNull(int index,
                    int type)
             throws java.sql.SQLException
Nullifies value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
type - the JDBC type code defined by java.sql.Types.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setNull

public void setNull(int index,
                    int type,
                    java.lang.String tname)
             throws java.sql.SQLException
Nullifies value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
type - the JDBC type code defined by java.sql.Types.
tname - the fully qualified name of the parameter being set.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setObject

public void setObject(int index,
                      java.lang.Object ob)
               throws java.sql.SQLException
Sets value of indexed parameter with an object.

Parameters:
index - the position of the parameter. It starts from 1.
ob - a Java object that holds the parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setObject

public void setObject(int index,
                      java.lang.Object ob,
                      int iType)
               throws java.sql.SQLException
Sets value of indexed parameter with data type conversion.

Parameters:
index - the position of the parameter. It starts from 1.
ob - a Java object that holds the parameter value.
iType - the JDBC type code defined by java.sql.Types.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setObject

public void setObject(int index,
                      java.lang.Object ob,
                      int iType,
                      int iScale)
               throws java.sql.SQLException
Sets value of indexed parameter with data type conversion and specified scale.

Parameters:
index - the position of the parameter. It starts from 1.
ob - a Java object that holds the parameter value.
iType - the JDBC type code defined by java.sql.Types.
iScale - the desired number of digits to the right of the decimal point.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setRef

public void setRef(int index,
                   java.sql.Ref ref)
            throws java.sql.SQLException
Sets the Ref value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
ref - a Ref parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setRSAgentList

public void setRSAgentList(PreparedStatementResultSet[] rsAgentList)
Sets PreparedStatementResultSet list and holds the list of result sets returned from the prepared statement.

Parameters:
rsAgentList - an array of PreparedStatementResultSet instances.
Throws:
None.
Returns:
void - None.

setRSAgentSigs

public void setRSAgentSigs(java.lang.String[] rsAgentSigs)
Sets ResultSetAgent signatures. A signature includes all the column names.

Parameters:
rsAgentSigs - an array of signatures in string.
Throws:
None.
Returns:
void - None.

setShort

public void setShort(int index,
                     short si)
              throws java.sql.SQLException
Sets the short value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
si - a short parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setString

public void setString(int index,
                      java.lang.String s)
               throws java.sql.SQLException
Sets the string value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
s - a String parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setTime

public void setTime(int index,
                    java.sql.Time t)
             throws java.sql.SQLException
Sets the time value of indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
t - a Time parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setTime

public void setTime(int index,
                    java.sql.Time t,
                    java.util.Calendar cal)
             throws java.sql.SQLException
Sets the time value of indexed parameter with time zone from calendar.

Parameters:
index - the position of the parameter. It starts from 1.
t - a Time parameter value.
cal - the Calendar object used to construct the Time object.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setTimestamp

public void setTimestamp(int index,
                         java.sql.Timestamp ts)
                  throws java.sql.SQLException
Sets the timestamp value of the indexed parameter.

Parameters:
index - the position of the parameter. It starts from 1.
ts - a Timestamp parameter value.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.

setTimestamp

public void setTimestamp(int index,
                         java.sql.Timestamp ts,
                         java.util.Calendar cal)
                  throws java.sql.SQLException
Sets the timestamp value of the indexed parameter including the time zone from the calendar.

Parameters:
index - the position of the parameter. It starts from 1.
ts - a Timestamp parameter value.
cal - the Calendar object used to construct the Time object.
Returns:
void - None.
Throws:
java.sql.SQLException - when SQL problems occur.


Copyright 2004 by SeeBeyond Technology Corporation. All Rights Reserved.