|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sqlj.runtime.ref.ConnectionContextImpl
The connection context impl class is an abstract implementation of the connection context interface. It does not implement the connection context interface directly, but rather just defines the connection context method implementations. Subclasses must be defined which provide the static methods and constructors described in the connection context documentation.
Generated context classes will extend this class and implement the connection context interface.
ConnectionContext
Constructor Summary |
Type | Constructor |
---|---|
protected |
ConnectionContextImpl(ProfileGroup profiles,
java.sql.Connection conn)
Creates a new connection context impl class with the given profile group and connection. |
protected |
ConnectionContextImpl(ProfileGroup profiles,
ConnectionContext other)
Creates a new connection context impl class with the given profile group which uses the same connection as that of the passed context. |
protected |
ConnectionContextImpl(ProfileGroup profiles,
java.lang.String dsname)
Creates a new connection context impl class with the given profile group which uses the default datasource connection. |
protected |
ConnectionContextImpl(ProfileGroup profiles,
java.lang.String url,
boolean autoCommit)
Creates a new connection context impl class with the given profile group and creates a new connection using the passed url. |
protected |
ConnectionContextImpl(ProfileGroup profiles,
java.lang.String url,
java.util.Properties info,
boolean autoCommit)
Creates a new connection context impl class with the given profile group and creates a new connection using the passed url and properties. |
protected |
ConnectionContextImpl(ProfileGroup profiles,
java.lang.String dsname,
java.lang.String user,
java.lang.String password)
Creates a new connection context impl class with the given profile group which uses the a datasource connection with particular username and password. |
protected |
ConnectionContextImpl(ProfileGroup profiles,
java.lang.String url,
java.lang.String user,
java.lang.String password,
boolean autoCommit)
Creates a new connection context impl class with the given profile group and creates a new connection using the passed url, user and password. |
Method Summary |
Type | Method |
---|---|
void |
close()
closes the context, its underlying connection and connected profiles. |
void |
close(boolean closeConnection)
Releases all resources used in maintaining database state on this context. |
sqlj.runtime.profile.ConnectedProfile |
getConnectedProfile(java.lang.Object profileKey)
Returns the connected profile associated with a profileKey for this connection context instance. |
java.sql.Connection |
getConnection()
Returns the underlying connection for this connection context. |
static int |
getDefaultStmtCacheSize()
|
ExecutionContext |
getExecutionContext()
Returns the default execution context used by this connection context. |
oracle.jdbc.OracleConnection |
getOracleConnection()
|
int |
getStmtCacheSize()
|
boolean |
isClosed()
Returns true if this context has been closed, false otherwise. |
static java.util.Properties |
loadProps(java.lang.Class loadCtx,
java.lang.String propName)
Read a properties file. |
static java.util.Hashtable |
loadTypeMap(java.lang.Class loadCtx,
java.lang.String propList)
Utility function to load the type map into a hastable. |
static void |
setDefaultStmtCacheSize(int size)
|
void |
setStmtCacheSize(int size)
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
protected ConnectionContextImpl(ProfileGroup profiles, java.sql.Connection conn) throws java.sql.SQLException
profiles
- the profile group for the context subclass.conn
- the underlying connection for this context instance.protected ConnectionContextImpl(ProfileGroup profiles, java.lang.String url, java.lang.String user, java.lang.String password, boolean autoCommit) throws java.sql.SQLException
profiles
- the profile group for the context subclass.url
- the database urluser
- the usernamepassword
- the user passwordautoCommit
- true if the connection
should be created in
auto-commit mode, false otherwise.DriverManager.getConnection(String,String,String)
,
Connection.setAutoCommit(boolean)
protected ConnectionContextImpl(ProfileGroup profiles, java.lang.String url, java.util.Properties info, boolean autoCommit) throws java.sql.SQLException
profiles
- the profile group for the context subclass.url
- the database urlproperties
- the properties for creating a connectionautoCommit
- true if the connection should
be created in
auto-commit mode, false otherwise.Connection.setAutoCommit(boolean)
,
DriverManager.getConnection(String,java.util.Properties)
protected ConnectionContextImpl(ProfileGroup profiles, java.lang.String url, boolean autoCommit) throws java.sql.SQLException
profiles
- the profile group for the context subclass.url
- the database urlautoCommit
- true if the connection should be created in
auto-commit mode, false otherwise.DriverManager.getConnection(String)
,
Connection.setAutoCommit(boolean)
protected ConnectionContextImpl(ProfileGroup profiles, ConnectionContext other) throws java.sql.SQLException
profiles
- the profile group for the context subclass.other
- a connection context instance with which to share a
connection.ConnectionContext.getConnection()
protected ConnectionContextImpl(ProfileGroup profiles, java.lang.String dsname) throws java.sql.SQLException
profiles
- the profile group for the context subclass.dsname
- name of the data sourceConnectionContext.getConnection()
protected ConnectionContextImpl(ProfileGroup profiles, java.lang.String dsname, java.lang.String user, java.lang.String password) throws java.sql.SQLException
profiles
- the profile group for the context subclass.dsname
- name of the data sourceConnectionContext.getConnection()
Method Detail |
public oracle.jdbc.OracleConnection getOracleConnection()
public int getStmtCacheSize()
public void setStmtCacheSize(int size) throws java.sql.SQLException
public static int getDefaultStmtCacheSize()
public static void setDefaultStmtCacheSize(int size)
public sqlj.runtime.profile.ConnectedProfile getConnectedProfile(java.lang.Object profileKey) throws java.sql.SQLException
profileKey
- the key asscoiated with the desired profile.ConnectionContext.getConnectedProfile(Object)
public void close() throws java.sql.SQLException
ConnectionContext.close()
public boolean isClosed()
ConnectionContext.isClosed()
public java.sql.Connection getConnection()
ConnectionContext.getConnection()
public void close(boolean closeConnection) throws java.sql.SQLException
Note: A context is automatically closed when it is garbage collected. A context closed in such a way does not close the underlying JDBC connection since it will also be automatically closed when it is garbage collected.
closeConnection
- is
true if the underlying Connection should
also be closed.ConnectionContext.close(boolean)
public ExecutionContext getExecutionContext()
public static java.util.Properties loadProps(java.lang.Class loadCtx, java.lang.String propName)
public static java.util.Hashtable loadTypeMap(java.lang.Class loadCtx, java.lang.String propList)
loadCtx
- class that describes the loading context for the type mappropList
- string that designates the name of the resource containing the type map
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |