All Packages    This Package  Previous  Next  

Class sqlj.runtime.profile.ref.JDBCProfile

java.lang.Object
   |
   +----sqlj.runtime.profile.ref.JDBCProfile

public class JDBCProfile
extends Object
implements DynamicProfile
A JDBCProfile is a dynamic connected profile that implements the getStatement, prepareStatement and prepareCall methods using the standard jdbc dynamic sql mapping. This profile employs lazy verification and creation of statement objects (no statements are created until requested).


Constructor Index

 o JDBCProfile(Connection, ProfileData)
Creates a new object which operates on the passed profile data using the passed connection.

Method Index

 o close()
Closes the jdbc connected profile instance resources.
 o getConnection()
 o getProfileData()
 o getSQLString(int)
Returns the sql string for the entry at the passed index.
 o getStatement(int)
Creates a statement implemented using JDBC.
 o prepareCall(String)
Creates and returns an instance of class RTStatementJDBCCallable.
 o prepareStatement(String)
Creates and returns an instance of class RTStatementJDBCPrepared.

Constructors

 o JDBCProfile
 public JDBCProfile(Connection conn,
                    ProfileData profileData)
Creates a new object which operates on the passed profile data using the passed connection.

Parameters:
conn - the JDBC connection from which to create statements
profileData - the profile data with which to operate
See Also:
getConnectedProfile

Methods

 o getProfileData
 public ProfileData getProfileData()
Returns:
s the profile data with which this object was created
 o getConnection
 public Connection getConnection()
Returns:
s the JDBC connection with which this object was created
 o getStatement
 public RTStatement getStatement(int ndx) throws SQLException
Creates a statement implemented using JDBC. If the statementType is CALLABLE, prepareCall is used to create the statement. Otherwise, prepareStatement is used. The string returned by the "getSQLString" method is used to create the statement.

Note: Out-parameters of the statement (if any) are not registered on the returned statement. It is the responsibility of the caller to register out parameters before executing the statement.

Throws: SQLException
if an error occurs while preparing statement
See Also:
getStatementType, prepareStatement, prepareCall
 o getSQLString
 protected String getSQLString(int ndx) throws SQLException
Returns the sql string for the entry at the passed index. By default, this is simply the SQLString stored in the given entry of the profile. Subclasses may override this method to provide alternate implementations.

Throws: SQLException
if an error occurs getting the SQLString
See Also:
getSQLString
 o prepareCall
 public RTCallableStatement prepareCall(String sql) throws SQLException
Creates and returns an instance of class RTStatementJDBCCallable. The underlying callable statement is created based on the passed operation text with a call to the standard JDBC defined Connection.prepareCall() method.

The caller must register out-parameters of the statement returned.

Parameters:
the - text of the sql operation to prepare
Throws: SQLException
if an error occurs while preparing call
See Also:
getSQLString, RTStatementJDBCCallable
 o prepareStatement
 public RTStatement prepareStatement(String sql) throws SQLException
Creates and returns an instance of class RTStatementJDBCPrepared. The underlying callable statement is created based on the passed operation text with a call to the standard JDBC defined Connection.prepareStatement() method.

Parameters:
the - text of the sql operation to prepare
Throws: SQLException
if an error occurs while preparing statement
See Also:
getSQLString, RTStatementJDBCPrepared
 o close
 public void close() throws SQLException
Closes the jdbc connected profile instance resources.

Throws: SQLException
if an error occurs while closing

All Packages    This Package  Previous  Next