IBM WebSphere Application ServerTM
Release 7

com.ibm.wbiserver.cmpa
Interface WSRelationalPushDownHelper

All Superinterfaces:
WSPushDownHelper

public interface WSRelationalPushDownHelper
extends WSPushDownHelper

This interface provides helper methods that can be used by customers in their implementations of their <beanName>UserDefinedPushDownMethods classes. This sub-interface adds relational-specific helpers beyond the generic helpers available in the super-interface.

Since:
WBI-SF 5.1

Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 javax.resource.cci.ResultSet createCCIResultSet(java.sql.ResultSet resultSet, java.lang.Object connection)
          This method creates a CCI ResultSet corresponding to the given SQL ResultSet.
 java.sql.Statement createStatement(java.lang.Object conn)
          This method gets a generic JDBC Statement from the connection.
 sqlj.runtime.ref.DefaultContext getConnectionContext(java.lang.Object conn)
          This method returns a SQLj connection context.
 int getLockType(java.lang.Object connection, AccessIntent accessIntent)
          This method returns the type of lock to be used for the current interaction with the back-end data store.
 java.sql.CallableStatement prepareCall(java.lang.Object conn, java.lang.String sql)
          This method gets a JDBC CallableStatement from the connection with the given SQL statement.
 java.sql.CallableStatement prepareCall(java.lang.Object conn, java.lang.String sql, int resultSetType, int resultSetConcurrency)
          This method gets a JDBC CallableStatement from the connection with the given SQL statement.
 java.sql.PreparedStatement prepareStatement(java.lang.Object conn, java.lang.String sql)
          This method gets a JDBC PreparedStatement from the connection.
 void returnCCIResultSet(javax.resource.cci.ResultSet resultSet)
          This method returns a CCI ResultSet to the cache.
 void returnPreparedStatement(java.lang.Object conn, java.sql.PreparedStatement stmt)
          This method returns a JDBC PreparedStatement to the cache.
 
Methods inherited from interface com.ibm.wbiserver.cmpa.WSPushDownHelper
createCCIIndexedRecord, createCCIRecord, createResourceException, createResourceException, returnCCIIndexedRecord
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

createStatement

java.sql.Statement createStatement(java.lang.Object conn)
                                   throws javax.resource.ResourceException

This method gets a generic JDBC Statement from the connection. This should only be used if neither a PreparedStatement nor a CallableStatement is desired.

Parameters:
conn - the connection from which to get the statement. This should be the connection object passed in to the method of the UserDefinedPushDownMethods implementation class.
Returns:
A WebSphere JDBC Statement
Throws:
javax.resource.ResourceException - thrown if an error occurs getting the Statement.
Since:
WBI-SF 5.1

prepareStatement

java.sql.PreparedStatement prepareStatement(java.lang.Object conn,
                                            java.lang.String sql)
                                            throws javax.resource.ResourceException

This method gets a JDBC PreparedStatement from the connection. A cache is used to improve performance; when done with the PreparedStatement, use the returnPreparedStatement method to return it to the cache.

Parameters:
conn - the connection from which to get the statement. This should be the connection object passed in to the method of the UserDefinedPushDownMethods implementation class.
sql - the SQL statement.
Returns:
A WebSphere PreparedStatement
Throws:
javax.resource.ResourceException - thrown if an error occurs getting the PreparedStatement.
Since:
WBI-SF 5.1

returnPreparedStatement

void returnPreparedStatement(java.lang.Object conn,
                             java.sql.PreparedStatement stmt)
                             throws javax.resource.ResourceException

This method returns a JDBC PreparedStatement to the cache.

Parameters:
conn - the connection from which to get the statement. This should be the connection object passed in to the method of the UserDefinedPushDownMethods implementation class.
stmt - The PreparedStatement to return to the cache
Throws:
javax.resource.ResourceException - thrown if an error occurs returning the PreparedStatement.
Since:
WBI-SF 5.1

prepareCall

java.sql.CallableStatement prepareCall(java.lang.Object conn,
                                       java.lang.String sql)
                                       throws javax.resource.ResourceException

This method gets a JDBC CallableStatement from the connection with the given SQL statement.

Parameters:
conn - the connection from which to get the statement. This should be the connection object passed in to the method of the UserDefinedPushDownMethods implementation class.
sql - the SQL statement.
Returns:
A WebSphere CallableStatement
Throws:
javax.resource.ResourceException - thrown if an error occurs getting the CallableStatement.
Since:
WBI-SF 5.1

prepareCall

java.sql.CallableStatement prepareCall(java.lang.Object conn,
                                       java.lang.String sql,
                                       int resultSetType,
                                       int resultSetConcurrency)
                                       throws javax.resource.ResourceException

This method gets a JDBC CallableStatement from the connection with the given SQL statement.

Parameters:
conn - the connection from which to get the statement. This should be the connection object passed in to the method of the UserDefinedPushDownMethods implementation class.
sql - the SQL statement.
resultSetType - a result set type; see ResultSet.TYPE_XXX
resultSetConcurrency - a concurrency type; see ResultSet.CONCUR_XXX
Returns:
A WebSphere CallableStatement
Throws:
javax.resource.ResourceException - thrown if an error occurs getting the CallableStatement.
Since:
WBI-SF 5.1

createCCIResultSet

javax.resource.cci.ResultSet createCCIResultSet(java.sql.ResultSet resultSet,
                                                java.lang.Object connection)
                                                throws javax.resource.ResourceException

This method creates a CCI ResultSet corresponding to the given SQL ResultSet. Such a CCI ResultSet can be returned from a method in the UserDefinedPushDownMethodsImpl, if the data in the result set is arranged in expected order (as documented in the generated JavaDoc comments for the UserDefinedPushDownMethodsImpl method).

If the specified object is already a javax.resource.cci.ResultSet, this method will return the specified object unchanged. Otherwise, this java.sql.ResultSet object will be wrapped in a CCI ResultSet.

Parameters:
resultSet - an SQL ResultSet to be wrapped in the CCI ResultSet.
connection - the connection object passed in to the method of the UserDefinedPushDownMethods implementation class.
Returns:
a CCI ResultSet
Throws:
javax.resource.ResourceException - thrown if an error occurs creating the CCI ResultSet
Since:
WBI-SF 5.1

returnCCIResultSet

void returnCCIResultSet(javax.resource.cci.ResultSet resultSet)
                        throws javax.resource.ResourceException

This method returns a CCI ResultSet to the cache.

Parameters:
resultSet - a CCI ResultSet
Throws:
javax.resource.ResourceException - thrown if an error occurs returning the CCI ResultSet to the cache
Since:
WBI-SF 5.1

getConnectionContext

sqlj.runtime.ref.DefaultContext getConnectionContext(java.lang.Object conn)
                                                     throws javax.resource.ResourceException

This method returns a SQLj connection context. This context contains the physical connection.

Parameters:
conn - the connection from which to get the context. This should be the connection object passed in to the method of the UserDefinedPushDownMethods implementation class.
Returns:
a SQLj connection context
Throws:
javax.resource.ResourceException - thrown if an error occurs creating the SQLj connection context
Since:
WBI-SF 5.1

getLockType

int getLockType(java.lang.Object connection,
                AccessIntent accessIntent)
                throws javax.resource.ResourceException

This method returns the type of lock to be used for the current interaction with the back-end data store.

Parameters:
connection - The current connection that is passed to the UserDefinedPushDownMethodsImpl class. It must implement the javax.resource.cci.Connection interface.
accessIntent - This class holds access-intent-related info of potential use by any UserDefinedPushDownMethodsImpl class. This method uses this parameter to locate the correct locktype in order to choose the right SQL Select syntax.
Returns:
the lock type which has one of the following values;
  • EJBToRAAdapter.LOCKTYPE_NOTAPPLICABLE = 0;
  • EJBToRAAdapter.LOCKTYPE_SELECT = 1;
  • EJBToRAAdapter.LOCKTYPE_SELECT_FOR_UPDATE = 2;
  • EJBToRAAdapter.LOCKTYPE_SELECT_FOR_UPDATE_WITH_RS = 3;
  • EJBToRAAdapter.LOCKTYPE_SELECT_FOR_UPDATE_WITH_RR = 4;
Throws:
javax.resource.ResourceException - thrown if the connection can not be cast to javax.resource.cci.Connection
Since:
WBI-SF 5.1
See Also:
EJBToRAAdapter.getLockType(ConnectionFactory, AccessIntent)

IBM WebSphere Application ServerTM
Release 7