MDi JLib
1.7.4

com.microdeveloper.data
Interface OracleStoredProcedureInterface


public interface OracleStoredProcedureInterface

Interface for implementing a Oracle Stored Procedure class which encapsulates connections, procedure, parameters and results. See the implementation class documentation for usage instructions.

Since:
1.5
Version:
1.0
Author:
MicroDeveloper, Inc.

Method Summary
 boolean addArg(int pos, int type, int dir, Object val)
          Add an argument to the this object.
 String argsToString(int callType)
          Convert the arguments to a String.
 boolean clearArg(int pos)
          Remove a single argument from the this object.
 boolean clearArgs()
          Remove all arguments from the this object.
 Object doFunction(Connection conn, String procedure)
          Executes a stored function.
 boolean doProcedure(Connection conn, String procedure)
          Executes a stored procedure.
 List getArg(int pos)
          Get a single argument from this object.
 Object getArgVal(int pos)
          Get a single arguments value.
 boolean setArgVal(int pos, Object val)
          Set an arguments value
 boolean setOutValues(CallableStatement s)
          Establish the outbound parameters
 boolean setParameter(CallableStatement s, int pos)
          Establish the argument as a parameter.
 

Method Detail

doFunction

Object doFunction(Connection conn,
                  String procedure)
                  throws SQLException
Executes a stored function.

Parameters:
conn - established connection object from a JDBC connection
procedure - name of the function to execute
Returns:
Object representing the result of the function
Throws:
SQLException - thrown if the function cannot be executed
See Also:
doProcedure(Connection,String), Connector, ConnectionPool

doProcedure

boolean doProcedure(Connection conn,
                    String procedure)
                    throws SQLException
Executes a stored procedure.

Parameters:
conn - established connection object from a JDBC connection
procedure - name of the procedure to execute
Returns:
result of the execution, true if successful, false otherwise
Throws:
SQLException - thrown if the procedure cannot be executed
See Also:
doFunction(Connection,String), Connector, ConnectionPool

addArg

boolean addArg(int pos,
               int type,
               int dir,
               Object val)
Add an argument to the this object. addArg accepts a position to identify the parameter, a direction of IN, OUT, or INOUT and, in the case of an IN or INOUT, an value.

Parameters:
pos - position in the procedures argument list
dir - argument direction in IN, OUT, or INOUT
val - the value of an IN or INOUT parameter

clearArgs

boolean clearArgs()
Remove all arguments from the this object.

Returns:
true if operation was successful, otherwise false

clearArg

boolean clearArg(int pos)
Remove a single argument from the this object.

Parameters:
pos - index of the element to remove
Returns:
true if operation was successful, otherwise false

getArg

List getArg(int pos)
Get a single argument from this object. If the argument does not exist no error is thrown.

Parameters:
pos - the index of the argument to return
Returns:
returns a list item representing the argument

getArgVal

Object getArgVal(int pos)
Get a single arguments value. If the argument does not exist null is returned.

Parameters:
pos - the index of the argument to return
Returns:
the value of the argument

setParameter

boolean setParameter(CallableStatement s,
                     int pos)
Establish the argument as a parameter.

Parameters:
s - CallableStatement to set
pos - argument index to set
Returns:
true of the operation succeeds, otherwise false

argsToString

String argsToString(int callType)
Convert the arguments to a String.

Parameters:
callType - a constant call type
Returns:
formatted argument string

setOutValues

boolean setOutValues(CallableStatement s)
Establish the outbound parameters

Parameters:
s - CallableStatement to set
Returns:
true if the operation succeeded, otherwise false

setArgVal

boolean setArgVal(int pos,
                  Object val)
Set an arguments value

Parameters:
pos - index of the argument to set
val - value of the argument
Returns:
true if the operation succeeded, otherwise false

MDi JLib
1.7.4

Copyright©2001-2007 MicroDeveloper, Inc. All Rights Reserved.