All Packages This Package Previous Next
Interface sqlj.runtime.profile.ConnectedProfile
- public interface interface ConnectedProfile
A ConnectedProfile object represents a profile which has been attached
to a particular jdbc connection. Since it is attached to a connection,
it is able to convert its contents into an executable statement object
on the associated connection. The implementation of this object may be
customized for the given data source, which allows it use to
optimizations that circumvent the jdbc dynamic sql model. Profile
customization will typically involve vendor-specific profile
transformations that allow more efficient sql execution such a
precompilation of sql text or use of stored procedures.
A connected profile creates statements which correspond to entries
at a particular index in the profile. The profile entry info at a
particular index can be used to determine how the corresponding
statement returned by a connected profile will be executed at runtime.
The statement returned need only respond to the execute method indicated
in the entry info.
The profile entry info at a particular index also characterizes the
statement type. A statement can be either PREPARED or CALLABLE, the
difference between the two being that CALLABLE statements may have
out-parameters whereas PREPARED statements will have only in-parameters.
All statements returned by a connected profile conforms to the
following requirements:
- The operation performed must be equivalent to the operation which
would have been performed if using regular jdbc and the text of the sql
statement directly.
- Any out-parameters of the operation must have been already
registered in the statement returned (CALLABLE statements only). The
profile describes each parameter to the operation in terms of its Java
class description. It is up to the implementation to properly register
the sql type for this class description as needed for the particular
jdbc (or vendor-specific) driver used.
If the connected profile is unable to create the desired statement,
an exception is raised. Note that a particular profile customization
might employ an eager verification model in which all entries in the
profile are verified against the connection when a connected profile is
created, or a lazy verification algorithm in which statements are not
verified until they are indexed via this method. It is up to the
implementation of a customization and connected profile to decide upon
an appropriate verification strategy.
- See Also:
- getStatementType, CALLABLE_STATEMENT, PREPARED_STATEMENT, getExecuteType
-
close()
- Closes this connected profile instance, releasing any resources
associated with it.
-
getConnection()
-
-
getProfileData()
- Returns the handle to the profile data object associated with this
connected profile.
-
getStatement(int)
- Returns a statement object representing the entry at index "ndx" in
the profile, where "ndx" is 0 based.
getProfileData
public abstract ProfileData getProfileData()
- Returns the handle to the profile data object associated with this
connected profile. The top level profile which created this connected
profile can be retrieved by calling the
getProfile
method
on the resulting profile data object.
- See Also:
- getConnectedProfile, getProfile
getConnection
public abstract Connection getConnection()
- Returns:
- the connection with which this profile was created
- See Also:
- getConnectedProfile
getStatement
public abstract RTStatement getStatement(int ndx) throws SQLException
- Returns a statement object representing the entry at index "ndx" in
the profile, where "ndx" is 0 based.
- Parameters:
- ndx - the index of the statement to return, 0 based.
- Throws: SQLException
- if an error occurs preparing the statement.
close
public abstract void close() throws SQLException
- Closes this connected profile instance, releasing any resources
associated with it. This is called when the ConnectionContext
asscoiated with the Profile is closed.
- Throws: SQLException
- if an error occurs while closing.
All Packages This Package Previous Next