|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConnectionManager
Connection Manager for local connections.
JDBC connections are never used directly. Instead Db-instances refer to a ConnectionManager
in order to use a connection. The usage of a connection is initiated by an attach operation.
After completion of the task (transaction, one-shot, etc...) the Db will be detached.
The connection manager as a broker in between the Db and a connection gives the opportunity to
multiplex connections. This is especially useful in application servers.
Note that connection managers are not used in remote Db instances.
| Method Summary | |
|---|---|
ManagedConnection |
attach(int id)
Attaches a Db to a connection.A Db must be attached before it can use any statements. |
void |
detach(int id)
Detaches a connection from a Db.A Db must be detached to release the connection for use of other Db instances. |
int |
getMaxConnections()
Gets the maximum number of connections. |
int |
getMaxLogins()
Gets the maximum number of allowed logins. |
int |
login(Db db)
Logs in a Db connection.It is up to the manager how to verify whether the Db is allowed to open, a real connection is initiated or just an application level authorization is performed. |
Db |
logout(int id)
Logs out a Db connection. |
void |
shutdown()
Shuts down this connection manager. All connections are closed and the threads stopped. |
| Method Detail |
|---|
int login(Db db)
throws DbRuntimeException
Db connection.
db - the db to login
DbRuntimeException - if login failed.
Db logout(int id)
throws DbRuntimeException
Db connection.
The Db is not allowed to attach anymore. If the Db is still attached,
a rollback of any pending tx is done and an exception thrown.
id - the connection ID of the db
DbRuntimeException - if logout failed.
ManagedConnection attach(int id)
throws DbRuntimeException
Db to a connection.
id - the connection ID of the db
DbRuntimeException - if attach failed.
void detach(int id)
throws DbRuntimeException
Db.
id - the connection ID of the db
DbRuntimeException - if detach failed.int getMaxLogins()
int getMaxConnections()
void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||