org.experlog.db
Class ESCallable

java.lang.Object
  extended by org.experlog.db.ESCallable
All Implemented Interfaces:
DataObject

public class ESCallable
extends java.lang.Object
implements DataObject

This class makes some delegation works on a CallableStatement object. We store an hashtable of parameters to get results


Constructor Summary
ESCallable(java.sql.CallableStatement stat, java.lang.String adatasource, java.sql.Connection con, Client session)
          create a new object with a CallableStatement object and initialize a list of parameters
 
Method Summary
 void close()
          closes all objects, this methods is called at the end of life of the current object.
 java.lang.String get(java.lang.String name)
          returns the value of the a given out parameter
 java.sql.CallableStatement getCallable()
          returns the underlying callable statement object
 java.sql.Connection getConnection()
           
 java.lang.String getDatasource()
          returns the name of the datasource which has been used to built the current callable statement
 java.util.Hashtable getParams()
          returns the list of the parameters
 void registerOutParameter(int pos, int type)
          registers a parameter with the position in the call string (@see the CallableStatement API) and the int representation of the parameter type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ESCallable

public ESCallable(java.sql.CallableStatement stat,
                  java.lang.String adatasource,
                  java.sql.Connection con,
                  Client session)
create a new object with a CallableStatement object and initialize a list of parameters

Parameters:
stat - a CallableStatement object
Method Detail

registerOutParameter

public void registerOutParameter(int pos,
                                 int type)
registers a parameter with the position in the call string (@see the CallableStatement API) and the int representation of the parameter type.

Parameters:
pos - the position of the parameter in the call string
type - the type of the parameter (@see java.sql.Types)

getParams

public java.util.Hashtable getParams()
returns the list of the parameters

Returns:
an Hashtable object which contains (key,value) of (parameter, parameter_value)

getCallable

public java.sql.CallableStatement getCallable()
returns the underlying callable statement object

Returns:
the current and unique CallableStatement object

get

public java.lang.String get(java.lang.String name)
                     throws java.sql.SQLException
returns the value of the a given out parameter

Specified by:
get in interface DataObject
Parameters:
name - the parameter name
Returns:
the parameter value
Throws:
java.sql.SQLException

getDatasource

public java.lang.String getDatasource()
returns the name of the datasource which has been used to built the current callable statement

Returns:
the string name of the datasource

close

public void close()
           throws java.sql.SQLException
closes all objects, this methods is called at the end of life of the current object.

Throws:
java.sql.SQLException

getConnection

public java.sql.Connection getConnection()