|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.db.execute.StatementWrapper oracle.javatools.db.execute.QueryWrapper oracle.javatools.db.execute.PlSqlWrapper
public class PlSqlWrapper
Wrapper for executing a stored procedure against the database using a CallableStatement.
query
) that has one IN
parameter (param1
) and one OUT parameter.
final PlSqlWrapper wrap = new PlSqlWrapper( db, query, param1 ); wrap.executePlSql( new PlSqlRunnable() { public void prepareCall( CallableStatement cs ) throws SQLException { cs.registerOutParameter( 2, Types.INTEGER ); } public void processCall( CallableStatement cs ) throws SQLException { final int outParam = cs.getInt(2); // we have our output! } } );
Nested Class Summary | |
---|---|
static class |
PlSqlWrapper.PlSqlRunnable
Runnable passed to the PlSqlWrapper to process the ResultSet and/or CallableStatement during execution. |
Nested classes/interfaces inherited from class oracle.javatools.db.execute.QueryWrapper |
---|
QueryWrapper.QueryRunnable |
Nested classes/interfaces inherited from class oracle.javatools.db.execute.StatementWrapper |
---|
StatementWrapper.ExecutionProxy, StatementWrapper.ExecutionRunnable<T>, StatementWrapper.Listener |
Constructor Summary | |
---|---|
PlSqlWrapper(Database db,
java.lang.String plsql,
java.lang.Object... params)
Creates a new wrapper for executing pl/sql, specifying the pl/sql itself and any IN parameters. |
Method Summary | |
---|---|
protected java.sql.Statement |
createStatment()
Creates the Statement object to use. |
void |
executePlSql(PlSqlWrapper.PlSqlRunnable runner)
Executes the stored procedure and processes the resulting ResultSet and CallableStatement with the given runner. |
Methods inherited from class oracle.javatools.db.execute.QueryWrapper |
---|
close, execute, executeQuery, executeQuery, getParameters, getQuery, getStatementTextForLog, union |
Methods inherited from class oracle.javatools.db.execute.StatementWrapper |
---|
addListener, doExecute, executeImpl, getConnection, getConnectionName, getDatabase, getExecutionProxy, getIdentifier, getStatement, getStatementStrings, hasCancelled, isIgnoreErrors, queryFinished, queryStarted, removeListener, setBypassExecutionProxy, setDatabase, setExecuting, setExecutionProxy, setIdentifier, setIgnoreErrors, setStatement, sqlTrace, throwDBException, throwDBException, throwDBException |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PlSqlWrapper(Database db, java.lang.String plsql, java.lang.Object... params)
db
- the database to use for executionquery
- the pl/sql to executeparams
- any IN parameters for the pl/sqlMethod Detail |
---|
protected java.sql.Statement createStatment() throws java.sql.SQLException
StatementWrapper
createStatment
in class QueryWrapper
java.sql.SQLException
public void executePlSql(PlSqlWrapper.PlSqlRunnable runner) throws DBException
runner
- to process the ResultSet and CallableStatement
DBException
- for any errors
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |