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).
-
JDBCProfile(Connection, ProfileData)
- Creates a new object which operates on the passed profile data using the
passed connection.
-
close()
- Closes the jdbc connected profile instance resources.
-
getConnection()
-
-
getProfileData()
-
-
getSQLString(int)
- Returns the sql string for the entry at the passed index.
-
getStatement(int)
- Creates a statement implemented using JDBC.
-
prepareCall(String)
- Creates and returns an instance of class RTStatementJDBCCallable.
-
prepareStatement(String)
- Creates and returns an instance of class RTStatementJDBCPrepared.
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
getProfileData
public ProfileData getProfileData()
- Returns:
- s the profile data with which this object was created
getConnection
public Connection getConnection()
- Returns:
- s the JDBC connection with which this object was created
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
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
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
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
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