|
Apache JMeter 1.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.jmeter.protocol.jdbc.util.DBConnectionManager
This class manages a pool of Connection objects (ConnectionObject). This pool is constantly checked for old, over-used, or dead connections in a separated thread. Connections are rented out and then given back by the DBConnect object and its subclasses. This class is not directly accessed by the end-user objects. It is accessed by the DBConnect object and its subclasses.
Method Summary | |
void |
close(DBKey key)
Closes out this object and returns resources to the system. |
Connection |
getConnection(DBKey key)
Rents out a database connection object. |
DBKey |
getKey(String url,
String username,
String password,
String driver,
int maxUsage,
int maxConnections)
Starts the connection manager going for a given database connection, and returns the DBKey object required to get a Connection object for this database. |
static DBConnectionManager |
getManager()
|
Connection |
newConnection(DBKey key)
Returns a new java.sql.Connection object. |
boolean |
registerDriver(String driver)
Registers a driver for a database. |
void |
releaseConnection(Connection c)
Releases a connection back to the pool. |
void |
setup(DBKey key)
Constructor. |
void |
shutdown()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static DBConnectionManager getManager()
public DBKey getKey(String url, String username, String password, String driver, int maxUsage, int maxConnections)
url
- URL of database to be connected to.username
- username to use to connect to database.password
- password to use to connect to database.driver
- driver to use for the database.maxUsage
- sets the maxUsage parameter for connections to this
database.maxConnections
- tells the DBConnectionManager how many connections
to keep active.
public void setup(DBKey key)
key
- DBKey that holds all information needed to set up a set of
connections.public void shutdown()
public Connection getConnection(DBKey key) throws NoConnectionsAvailableException
NoConnectionsAvailableException
public void releaseConnection(Connection c)
c
- Connection object being returnedpublic Connection newConnection(DBKey key) throws SQLException
SQLException
public void close(DBKey key)
public boolean registerDriver(String driver)
driver
- full classname for the driver.
|
Apache JMeter 1.9 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |