|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.wm.app.b2b.server.DBConnectionManager
public class DBConnectionManager
The DBConnectionManager class contains methods that are used to manage database connections.
Constructor Summary | |
---|---|
DBConnectionManager()
|
Method Summary | |
---|---|
static DBConnection |
getConnection(java.lang.String url,
java.lang.String user,
java.lang.String pass,
java.lang.Object args)
Establishes a database connection using the specified parameters. |
static DBConnection |
getConnection(java.lang.String url,
java.lang.String user,
java.lang.String pass,
java.lang.Object args,
java.lang.String sid)
Establishes a database connection using an existing connection object with the specified session ID. |
static void |
getConnectionInfo(Values report)
Provides information about the current open connections, including the number of open connections and a list of open connections by session ID. |
static void |
init()
Initializes the DBConnectionManager. |
static void |
reapConnections()
Releases all open database connections whose sessions have expired. |
static int |
returnAllConnections(java.lang.String sid)
Closes all connections associated with the specified session. |
static void |
returnConnection(DBConnection conn)
Closes the connection and clears references to it, This action removes the connection from the session-based sub-pool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DBConnectionManager()
Method Detail |
---|
public static void init()
public static DBConnection getConnection(java.lang.String url, java.lang.String user, java.lang.String pass, java.lang.Object args) throws DBConnectionException
url
- A String specifying the URL of the database to which you want to connect.user
- A String specifying the user name that is to be used to connect to the
database.pass
- A String specifying the password that is to be used to connect to the
database.args
- An Object containing any additional arguments that the database or driver
needs in order to make a connection. For example, to establish a JDBC connection, you must provide
the driver name.
DBConnectionException
- If a connection cannot be established.public static DBConnection getConnection(java.lang.String url, java.lang.String user, java.lang.String pass, java.lang.Object args, java.lang.String sid) throws DBConnectionException
url
- A String specifying the URL of the database to which you want to connect.user
- A String specifying the user name that is to be used to connect to the
database.pass
- A String specifying the password that is to be used to connect to the
database.sid
- A String specifying the session ID of the database connection you want to
reuse.
DBConnectionException
- If anything goes wrong connecting to the
database.public static void returnConnection(DBConnection conn)
conn
- The DBConnection you want to close.public static int returnAllConnections(java.lang.String sid)
sid
- A String specifying the session ID whose database connections you want to
close.
public static void getConnectionInfo(Values report)
report
- A Values object that contains the following keys:public static void reapConnections()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |