|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.altair.hwm.database.dbmodel.HWMDBCxnPool
public class HWMDBCxnPool
Title: HWMDBCxnPool
Description: This class handles the database connection pool. This has been modified to suit Altair's requirements
Company: Altair Engineering, Inc.
A class for preallocating, recycling, and managing JDBC connections. Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.
Constructor Summary | |
---|---|
HWMDBCxnPool(java.lang.String strSQLInfoClass,
java.lang.String strURL,
int nPort,
java.lang.String strDBName,
java.lang.String strUser,
java.lang.String strPwd,
int nInitialCxns,
int nMaxCxns)
Constructor |
Method Summary | |
---|---|
void |
CloseAllConnections()
Close all the connections. |
void |
FreeConnection(java.sql.Connection cxn)
Make the cxn available to other clients. |
java.sql.Connection |
GetConnection()
Returns a free connection. |
HWMDatabaseInfo |
GetDatabaseInfo()
Returns the database info class |
int |
GetTotalConnections()
Returns the total connections created |
java.lang.String |
GetURL()
Returns the URL of the databse |
java.lang.String |
GetUser()
Returns the user name who connects to the database |
void |
run()
The run method of the thread |
java.lang.String |
toString()
String representation of this class |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HWMDBCxnPool(java.lang.String strSQLInfoClass, java.lang.String strURL, int nPort, java.lang.String strDBName, java.lang.String strUser, java.lang.String strPwd, int nInitialCxns, int nMaxCxns) throws java.lang.Exception
strSQLInfoClass
- The SQL info class which will be used for
connecting to DBstrURL
- The URL to the db machinenPort
- The port to which the DB server is listening tostrDBName
- The DB name to connect tostrUser
- The user namestrPwd
- The passwordnInitialCxns
- The initial number of connectionsnMaxCxns
- The maximum number of connections allowed
java.lang.Exception
Method Detail |
---|
public java.sql.Connection GetConnection() throws java.sql.SQLException
java.sql.SQLException
public void run()
run
in interface java.lang.Runnable
public void FreeConnection(java.sql.Connection cxn)
cxn
- the connection that needs to be made availablepublic int GetTotalConnections()
public void CloseAllConnections()
public java.lang.String GetUser()
public java.lang.String GetURL()
public HWMDatabaseInfo GetDatabaseInfo()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |