{
try
{
// Code is specific to a CallableStatement. Cast will throw an exception
// if the caller tries to pass anyother type of object into the method.
final CallableStatement cs = (CallableStatement) statement;
if( cs != null && "cast".equals( action ) )
{
// Cast and register the output parameter at position "position" to be an
// Oracle CURSOR type. If the Oracle JDBC driver ZIP / JAR file is not
// in the method compiler's classpath, then this will cause an error.
cs.registerOutParameter( position, OracleTypes.CURSOR );
}
else if( cs != null && "set".equals( action ) )
{
// The "set" action is not supported for result sets so throw an
// exception to alert the caller to the problem.
throw new Exception( "Cannot set the value of a ResultSet" );
}
}
catch( Throwable t )
{
// If anything goes wrong, then log an error to the Bowstreet Event log
// and rethrow the exception for handling by the model.
throw new WebAppRuntimeException( t );
}