com.stc.connector.oracleappsadapter
Class OracleappsCallableStatementAgent

com.stc.connector.oracleappsadapter.OracleappsPreparedStatementAgent
  |
  +--com.stc.connector.oracleappsadapter.OracleappsCallableStatementAgent

public abstract class OracleappsCallableStatementAgent
extends OracleappsPreparedStatementAgent

Agent hosts an OracleappsCallableStatement.


Constructor Summary
protected OracleappsCallableStatementAgent()
          Default constructor.
  OracleappsCallableStatementAgent(Session session, int iScroll, int iConcur)
          OracleappsCallableStatementAgent constructor.
  OracleappsCallableStatementAgent(Session session, java.lang.String sCommand)
          OracleappsCallableStatementAgent constructor.
  OracleappsCallableStatementAgent(Session session, java.lang.String sCommand, int iScroll, int iConcur)
          OracleappsCallableStatementAgent constructor.
 
Method Summary
 void clearParameters()
          If using the Oracleapps native driver, that supports clob, all temporary clobs are freed when the value of all parameters are cleared.
protected  void createResultSets()
          Instantiates the ResultSet nodes added to this Procedure by matching the ResultSet object's signature at runtime.
 boolean execute()
          Executes the Procedure & sets the ResultSets of this procedure if any matches the OTD definition.
 java.sql.Array getArray(int index)
          Gets the Array value of the indexed parameter.
 java.math.BigDecimal getBigDecimal(int index)
          Gets the decimal value of the indexed parameter.
 java.sql.Blob getBlob(int index)
          Gets the Blob value of the indexed parameter.
 boolean getBoolean(int index)
          Gets the boolean value of the indexed parameter.
 byte getByte(int index)
          Gets the byte value of the indexed parameter.
 byte[] getBytes(int index)
          Gets the byte array value of the indexed parameter.
 java.sql.Clob getClob(int index)
          Gets the Clob value of the indexed parameter.
 java.sql.Date getDate(int index)
          Gets the date value of the indexed parameter.
 java.sql.Date getDate(int index, java.util.Calendar calendar)
          Gets the date value of the indexed parameter with time zone from calendar.
 double getDouble(int index)
          Gets the double value of the indexed parameter.
 float getFloat(int index)
          Gets the float value of the indexed parameter.
 int getInt(int index)
          Gets the integer value of the indexed parameter.
 long getLong(int index)
          Gets the long value of the indexed parameter.
 boolean getMoreResults()
          Moves the current resultset to next and returns true if the next resultset is available.
 boolean getMoreResults(int current)
          Moves the current resultset to next and returns true if the next resultset is available.
 java.lang.Object getObject(int index)
          Gets value of the indexed parameter as an instance of Object.
 java.lang.Object getObject(int index, java.util.Map map)
          Gets the value of the indexed parameter as an instance of Object and uses map for the customer mapping of the parameter value.
 java.sql.Ref getRef(int index)
          Gets the Ref value of the indexed parameter.
 ResultSetAgent getResultSet()
          Gets the current ResultSet.
 int[] getResultSetParamsPosition()
          gets those parameter positions of a Procedure that are of type ResultSet.
protected  com.stc.otd.runtime.OtdMeta[] getResultSetsMeta()
          Gets the meta info about the ResultSets added to this Procedure.
protected  OracleappsCallableStatementResultSet[] getResultSetsObjects()
          Gets the ResultSets added to this Procedure.
protected  java.lang.Class[] getResultSetTypes()
          Gets the Class info about the ResultSets added to this Procedure.
 short getShort(int index)
          Gets the short value of the indexed parameter.
 java.lang.String getString(int index)
          Gets the string value of the indexed parameter.
 java.sql.Time getTime(int index)
          Gets the time value of the indexed parameter.
 java.sql.Time getTime(int index, java.util.Calendar calendar)
          Gets time value of the indexed parameter with time zone from calendar.
 java.sql.Timestamp getTimestamp(int index)
          Gets the timestamp value of the indexed parameter.
 java.sql.Timestamp getTimestamp(int index, java.util.Calendar calendar)
          Gets the timestamp value of the indexed parameter with time zone from calendar.
 boolean matchResultSets(java.sql.ResultSet rs, com.stc.otd.runtime.OtdMeta otdMeta)
          Matches a ResultSet and OtdMeta based on their signatures.
 void registerOutParameter(int index, int iType)
          Registers the indexed OUT parameter with specified type.
 void registerOutParameter(int index, int iType, int iScale)
          Registers the indexed OUT parameter with specified type and scale.
 void registerOutParameter(int index, int iType, java.lang.String sType)
          Registers the indexed OUT parameter with specified user-named type or REF type.
protected abstract  void registerOutParameters()
          Registers all output parameters of the prepared call.
 boolean resultsAvailable()
          Determines whether next resultset is available after an execute.
 void sessionClosed(SessionEvent evt)
          If using an Oracleapps native driver, that supports clob, all temporary clobs are freed when the session is closed.
 void sessionOpen(SessionEvent evt)
          Processes a SessionOpen event.
 void setClob(int index, java.lang.Object obj)
          Sets the Clob value of the indexed parameter.
 void setResultSetParamsPosition(int[] newResultSetParamsPosition)
          marks those parameters of a Procedure that are of type ResultSet.
protected  void setResultSetsMeta(com.stc.otd.runtime.OtdMeta[] resultSetsMeta)
          Sets the meta info about the ResultSets that were added to this Procedure.
protected  void setResultSetsObjects(OracleappsCallableStatementResultSet[] newResultSetsObjects)
          Sets the ResultSets added to this Procedure.
protected  void setResultSetTypes(java.lang.Class[] resultSetTypes)
          Sets the Class info about the ResultSets added to this Procedure.
 boolean wasNull()
          Checks whether or not the last OUT parameter read had the SQL NULL value.
 
Methods inherited from class com.stc.connector.oracleappsadapter.OracleappsPreparedStatementAgent
setOracleappsCursorOrds
 

Constructor Detail

OracleappsCallableStatementAgent

protected OracleappsCallableStatementAgent()
Default constructor.

OracleappsCallableStatementAgent

public OracleappsCallableStatementAgent(Session session,
                                        int iScroll,
                                        int iConcur)
OracleappsCallableStatementAgent constructor.

Parameters:
session - a Session object used to hold connection information.
iScroll - resultset type; TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
iConcur - concurrency type; CONCUR_READ_ONLY, CONCUR_UPDATABLE
Throws:
None.

OracleappsCallableStatementAgent

public OracleappsCallableStatementAgent(Session session,
                                        java.lang.String sCommand)
OracleappsCallableStatementAgent constructor.

Parameters:
session - a Session object used to hold connection information.
sCommand - a SQL statement for invoking a stored procedure.
Throws:
None.

OracleappsCallableStatementAgent

public OracleappsCallableStatementAgent(Session session,
                                        java.lang.String sCommand,
                                        int iScroll,
                                        int iConcur)
OracleappsCallableStatementAgent constructor.

Parameters:
session - a Session object used to hold connection information.
sCommand - a SQL statement for invoking a stored procedure.
iScroll - resultset type; TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
iConcur - concurrency type; CONCUR_READ_ONLY, CONCUR_UPDATABLE
Throws:
None.
Method Detail

clearParameters

public void clearParameters()
                     throws java.sql.SQLException
If using the Oracleapps native driver, that supports clob, all temporary clobs are freed when the value of all parameters are cleared.

Parameters:
None.
Returns:
void - None.
Throws:
java.sql.SQLException - when there are problems in cleaning the parameters.

createResultSets

protected void createResultSets()
Instantiates the ResultSet nodes added to this Procedure by matching the ResultSet object's signature at runtime.

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

execute

public boolean execute()
                throws java.sql.SQLException
Executes the Procedure & sets the ResultSets of this procedure if any matches the OTD definition.

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

getArray

public java.sql.Array getArray(int index)
                        throws java.sql.SQLException
Gets the Array value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
an Array object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getBigDecimal

public java.math.BigDecimal getBigDecimal(int index)
                                   throws java.sql.SQLException
Gets the decimal value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a BigDecimal object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getBlob

public java.sql.Blob getBlob(int index)
                      throws java.sql.SQLException
Gets the Blob value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a Blob object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getBoolean

public boolean getBoolean(int index)
                   throws java.sql.SQLException
Gets the boolean value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
true or false.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getByte

public byte getByte(int index)
             throws java.sql.SQLException
Gets the byte value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a byte value.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getBytes

public byte[] getBytes(int index)
                throws java.sql.SQLException
Gets the byte array value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a byte array.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getClob

public java.sql.Clob getClob(int index)
                      throws java.sql.SQLException
Gets the Clob value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a Clob object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getDate

public java.sql.Date getDate(int index)
                      throws java.sql.SQLException
Gets the date value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a Date object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getDate

public java.sql.Date getDate(int index,
                             java.util.Calendar calendar)
                      throws java.sql.SQLException
Gets the date value of the indexed parameter with time zone from calendar.

Parameters:
index - the position of the parameter.
calendar - the Calendar object to use to construct the Date object.
Returns:
a Date object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getDouble

public double getDouble(int index)
                 throws java.sql.SQLException
Gets the double value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a double.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getFloat

public float getFloat(int index)
               throws java.sql.SQLException
Gets the float value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a float value.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getInt

public int getInt(int index)
           throws java.sql.SQLException
Gets the integer value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
an integer.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getLong

public long getLong(int index)
             throws java.sql.SQLException
Gets the long value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a long value.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getMoreResults

public boolean getMoreResults()
                       throws java.sql.SQLException
Moves the current resultset to next and returns true if the next resultset is available.

Parameters:
None.
Returns:
true if the next result is available.
Throws:
None.

getMoreResults

public boolean getMoreResults(int current)
                       throws java.sql.SQLException
Moves the current resultset to next and returns true if the next resultset is available.

Parameters:
current - one of the following Statement constants indicating what should happen to current ResultSet objects obtained using the method getResultSetCLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS .
Returns:
true if the next result is available. C

getObject

public java.lang.Object getObject(int index)
                           throws java.sql.SQLException
Gets value of the indexed parameter as an instance of Object.

Parameters:
index - the position of the parameter.
Returns:
an object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getObject

public java.lang.Object getObject(int index,
                                  java.util.Map map)
                           throws java.sql.SQLException
Gets the value of the indexed parameter as an instance of Object and uses map for the customer mapping of the parameter value.

Parameters:
index - the position of the parameter.
map - contains the mapping from SQL type names for user-defined types to class.
Returns:
an object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getRef

public java.sql.Ref getRef(int index)
                    throws java.sql.SQLException
Gets the Ref value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a Ref object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getResultSet

public ResultSetAgent getResultSet()
                            throws java.sql.SQLException
Gets the current ResultSet. Used in conjunction with getMoreResults().

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

getResultSetParamsPosition

public int[] getResultSetParamsPosition()
gets those parameter positions of a Procedure that are of type ResultSet.

getResultSetsMeta

protected com.stc.otd.runtime.OtdMeta[] getResultSetsMeta()
Gets the meta info about the ResultSets added to this Procedure.

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

getResultSetsObjects

protected OracleappsCallableStatementResultSet[] getResultSetsObjects()
Gets the ResultSets added to this Procedure.

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

getResultSetTypes

protected java.lang.Class[] getResultSetTypes()
Gets the Class info about the ResultSets added to this Procedure.

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

getShort

public short getShort(int index)
               throws java.sql.SQLException
Gets the short value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a short value.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getString

public java.lang.String getString(int index)
                           throws java.sql.SQLException
Gets the string value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a String object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getTime

public java.sql.Time getTime(int index)
                      throws java.sql.SQLException
Gets the time value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a Time object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getTime

public java.sql.Time getTime(int index,
                             java.util.Calendar calendar)
                      throws java.sql.SQLException
Gets time value of the indexed parameter with time zone from calendar.

Parameters:
index - the position of the parameter.
calendar - the Calendar object to use to construct the Time object.
Returns:
a Time object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getTimestamp

public java.sql.Timestamp getTimestamp(int index)
                                throws java.sql.SQLException
Gets the timestamp value of the indexed parameter.

Parameters:
index - the position of the parameter.
Returns:
a Timestamp object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

getTimestamp

public java.sql.Timestamp getTimestamp(int index,
                                       java.util.Calendar calendar)
                                throws java.sql.SQLException
Gets the timestamp value of the indexed parameter with time zone from calendar.

Parameters:
index - the position of the parameter.
calendar - the Calendar object to use to construct the Timestamp object.
Returns:
a Timestamp object.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

matchResultSets

public boolean matchResultSets(java.sql.ResultSet rs,
                               com.stc.otd.runtime.OtdMeta otdMeta)
Matches a ResultSet and OtdMeta based on their signatures.

registerOutParameter

public void registerOutParameter(int index,
                                 int iType)
                          throws java.sql.SQLException
Registers the indexed OUT parameter with specified type.

Parameters:
index - the position of the parameter.
iType - the JDBC type code defined by java.sql.Types.
Returns:
void - None.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

registerOutParameter

public void registerOutParameter(int index,
                                 int iType,
                                 int iScale)
                          throws java.sql.SQLException
Registers the indexed OUT parameter with specified type and scale.

Parameters:
index - the position of the parameter.
iType - the JDBC type code defined by java.sql.Types.
iScale - the desired number of digits to the right of the decimal point. It must be >= 0.
Returns:
void - None.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

registerOutParameter

public void registerOutParameter(int index,
                                 int iType,
                                 java.lang.String sType)
                          throws java.sql.SQLException
Registers the indexed OUT parameter with specified user-named type or REF type.

Parameters:
index - the position of the parameter.
iType - the JDBC type code defined by java.sql.Types.
sType - the fully-qualified SQL name of the user-named type.
Returns:
void - None.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

registerOutParameters

protected abstract void registerOutParameters()
                                       throws java.sql.SQLException
Registers all output parameters of the prepared call. The builder will generate the concrete method.
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.

resultsAvailable

public boolean resultsAvailable()
                         throws java.sql.SQLException
Determines whether next resultset is available after an execute.

Overrides:
resultsAvailable in class OracleappsPreparedStatementAgent
Returns:
true if any Result Sets is available.
Throws:
java.sql.SQLException - when SQL problems occur. when SQL problems occur.
Parameters:
None.

sessionClosed

public void sessionClosed(SessionEvent evt)
If using an Oracleapps native driver, that supports clob, all temporary clobs are freed when the session is closed.

Parameters:
evt - a SessionEvent instance.
Returns:
void - None.
Throws:
None.

sessionOpen

public void sessionOpen(SessionEvent evt)
Processes a SessionOpen event. It will prepare the call to invoke the stored procedure and register all the output parameters by calling registerOutParameters().

Parameters:
evt - a Session event which signals the connection is open.
Returns:
void - None.
Throws:
None.

setClob

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

Parameters:
index - index of the parameter
obj - the object value the parameter will be set with
Returns:
void - None.
Throws:
java.sql.SQLException - when there are problems in setting the CLOB value.

setResultSetParamsPosition

public void setResultSetParamsPosition(int[] newResultSetParamsPosition)
marks those parameters of a Procedure that are of type ResultSet.

setResultSetsMeta

protected void setResultSetsMeta(com.stc.otd.runtime.OtdMeta[] resultSetsMeta)
Sets the meta info about the ResultSets that were added to this Procedure.

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

setResultSetsObjects

protected void setResultSetsObjects(OracleappsCallableStatementResultSet[] newResultSetsObjects)
Sets the ResultSets added to this Procedure.

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

setResultSetTypes

protected void setResultSetTypes(java.lang.Class[] resultSetTypes)
Sets the Class info about the ResultSets added to this Procedure.

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

wasNull

public boolean wasNull()
                throws java.sql.SQLException
Checks whether or not the last OUT parameter read had the SQL NULL value.

Parameters:
None.
Returns:
true if the last parameter read was NULL;false otherwise
Throws:
java.sql.SQLException - which contains information about errors in accessing the database.


Copyright 2004 by SeeBeyond Technology Corporation. All Rights Reserved.