| java.lang.Object com.teamkonzept.db.TKDBConnectionManager
TKDBConnectionManager | public class TKDBConnectionManager (Code) | | Manages database connections for an application context.
Each application context has its TKDBConnectionManager, which
provides its threads with database connections.
The manager contains all data needed to maintain connections to a database like
- database name,
- driver,
- username,
- password in
TKConnectData TKConnectData
Furthermore the manager contains information about data types supported by the database in
TKSQLTypeConverter TKSQLTypeConverter ,
a hash for the used query classes, a hash for the connections of threads,
a stack with currently unused connections,
and a mechanism for limiting simultaneously opened connections
TKLimiter TKLimiter .
|
getConnection | public Connection getConnection() throws SQLException(Code) | | Returns the connection of the current thread.
Connection the connection of the current thread. |
getConnectionData | public TKConnectData getConnectionData()(Code) | | Returns the connect data of the TKDBConnectionManager .
TKConnectData the connect data of this manager. |
getTKDBConnection | public TKDBConnection getTKDBConnection() throws SQLException(Code) | | Returns the TKDBConnection of the current thread.
If there is no connection available in
TKHashtable TKHashtable tkConnectionHash
and Stack tkConnectionStack is empty, a new connection will be opened.
If the limit, defined in the
TKLimiter TKLimiter limiter , of opened connections
will be exceeded, the current thread has to wait.
TKDBConnection TKDBConnection TKDBConnection of current thread. throws: SQLException - |
limitConnections | public synchronized void limitConnections(int count)(Code) | | |
newQuery | public TKQuery newQuery(Class inQueryClass) throws SQLException(Code) | | Instantiates an object of the specified class inQueryClass and adds it
to the queries maintained by this TKDBConnectionManager
within the
TKHashtable TKHashtable queryClasses .
Parameters: inQueryClass - the class definition for the TKQuery to instantiate. the instantiated TKQuery |
resetConnections | public synchronized void resetConnections()(Code) | | |
setConnectionData | public synchronized void setConnectionData(TKConnectData data)(Code) | | Sets the connection data object of this manager.
Parameters: data - the TKConnectData TKConnectData object to set. |
|
|