|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.server.sql.IfsStatement | +--oracle.ifs.server.sql.IfsPreparedStatement | +--oracle.ifs.server.sql.IfsCallableStatement
IfsCallableStatement is used to execute SQL stored procedures.
JDBC provides a stored procedure SQL escape that allows stored procedures to be called in a standard way for all RDBMS's. This escape syntax has one form that includes a result parameter and one that does not. If used, the result parameter must be registered as an OUT parameter. The other parameters may be used for input, output or both. Parameters are refered to sequentially, by number. The first parameter is 1.
{?= call
{call
IN parameter values are set using the set methods inherited from PreparedStatement. The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via the get methods provided here.
An IfsCallableStatement may return a ResultSet or multiple ResultSets. Multiple ResultSets are handled using operations inherited from Statement.
For maximum portability, a call's ResultSets and update counts should be processed prior to getting the values of output parameters.
IfsConnection.prepareCall(java.lang.String)
,
ResultSet
Constructor Summary | |
IfsCallableStatement(java.sql.CallableStatement cstmt,
IfsConnection iconn)
Construct an IfsCallableStatement object. |
Method Summary | |
void |
dispose()
Dispose and close the IfsCallableStatement. |
java.math.BigDecimal |
getBigDecimal(int parameterIndex,
int scale)
Get the value of a NUMERIC parameter as a java.math.BigDecimal object. |
boolean |
getBoolean(int parameterIndex)
Get the value of a BIT parameter as a Java boolean. |
byte |
getByte(int parameterIndex)
Get the value of a TINYINT parameter as a Java byte. |
byte[] |
getBytes(int parameterIndex)
Get the value of a SQL BINARY or VARBINARY parameter as a Java byte[] |
java.sql.Date |
getDate(int parameterIndex)
Get the value of a SQL DATE parameter as a Date object |
double |
getDouble(int parameterIndex)
Get the value of a DOUBLE parameter as a Java double. |
float |
getFloat(int parameterIndex)
Get the value of a FLOAT parameter as a Java float. |
int |
getInt(int parameterIndex)
Get the value of an INTEGER parameter as a Java int. |
long |
getLong(int parameterIndex)
Get the value of a BIGINT parameter as a Java long. |
java.lang.Object |
getObject(int parameterIndex)
Get the value of a parameter as a Java object. |
short |
getShort(int parameterIndex)
Get the value of a SMALLINT parameter as a Java short. |
java.lang.String |
getString(int parameterIndex)
Get the value of a CHAR, VARCHAR, or LONGVARCHAR parameter as a Java String. |
java.sql.Time |
getTime(int parameterIndex)
Get the value of a SQL TIME parameter as a Time object. |
java.sql.Timestamp |
getTimestamp(int parameterIndex)
Get the value of a SQL TIMESTAMP parameter as a Timestamp object. |
void |
registerOutParameter(int parameterIndex,
int sqlType)
Before executing a stored procedure call, you must explicitly call registerOutParameter to register the Type of each out parameter. |
void |
registerOutParameter(int parameterIndex,
int sqlType,
int scale)
Use this version of registerOutParameter for registering Numeric or Decimal out parameters. |
boolean |
wasNull()
An OUT parameter may have the value of SQL NULL; wasNull reports whether the last value read has this special value. |
Methods inherited from class oracle.ifs.server.sql.IfsPreparedStatement |
clearParameters, execute, executeQuery, executeUpdate, setAsciiStream, setBigDecimal, setBinaryStream, setBoolean, setByte, setBytes, setDate, setDouble, setFloat, setInt, setLong, setNull, setObject, setObject, setObject, setShort, setString, setTime, setTimestamp, setUnicodeStream |
Methods inherited from class oracle.ifs.server.sql.IfsStatement |
cancel, clearWarnings, close, execute, executeQuery, executeUpdate, getMaxFieldSize, getMaxRows, getMoreResults, getQueryTimeout, getResultSet, getSession, getUpdateCount, getWarnings, setCursorName, setEscapeProcessing, setMaxFieldSize, setMaxRows, setQueryTimeout |
Constructor Detail |
public IfsCallableStatement(java.sql.CallableStatement cstmt, IfsConnection iconn)
cstmt
- instance of CallableStatementiconn
- iFS version of ConnectionMethod Detail |
public void registerOutParameter(int parameterIndex, int sqlType) throws java.sql.SQLException
Note: When reading the value of an out parameter, you must use the getXXX method whose Java type XXX corresponds to the parameter's registered SQL type.
parameterIndex
- the first parameter is 1, the second is 2,...sqlType
- SQL type code defined by Types;
for parameters of type Numeric or Decimal use the version of
registerOutParameter that accepts a scale valuejava.sql.SQLException
- if a database-access error occurs.public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws java.sql.SQLException
Note: When reading the value of an out parameter, you must use the getXXX method whose Java type XXX corresponds to the parameter's registered SQL type.
parameterIndex
- the first parameter is 1, the second is 2, ...sqlType
- use either Type.NUMERIC or Type.DECIMALscale
- a value greater than or equal to zero representing the
desired number of digits to the right of the decimal pointjava.sql.SQLException
- if a database-access error occurs.public boolean wasNull() throws java.sql.SQLException
Note: You must first call getXXX on a parameter to read its value and then call wasNull() to see if the value was SQL NULL.
java.sql.SQLException
- if a database-access error occurs.public java.lang.String getString(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public boolean getBoolean(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public byte getByte(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public short getShort(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public int getInt(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public long getLong(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public float getFloat(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public double getDouble(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public java.math.BigDecimal getBigDecimal(int parameterIndex, int scale) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...scale
- a value greater than or equal to zero representing the
desired number of digits to the right of the decimal pointjava.sql.SQLException
- if a database-access error occurs.public byte[] getBytes(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public java.sql.Date getDate(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public java.sql.Time getTime(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public java.sql.Timestamp getTimestamp(int parameterIndex) throws java.sql.SQLException
parameterIndex
- the first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public java.lang.Object getObject(int parameterIndex) throws java.sql.SQLException
This method returns a Java object whose type coresponds to the SQL type that was registered for this parameter using registerOutParameter.
Note that this method may be used to read datatabase-specific, abstract data types. This is done by specifying a targetSqlType of java.sql.types.OTHER, which allows the driver to return a database-specific Java type.
parameterIndex
- The first parameter is 1, the second is 2, ...java.sql.SQLException
- if a database-access error occurs.public void dispose()
dispose
in class IfsPreparedStatement
|
Oracle Content Management SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |