|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dmonix.jdbc.DMConnectionPool
The class makes connections available to calling program in its getConnection method.
This method searches for an available connection in the connection pool.
If no connection is available from the pool, a new connection is created.
If a connection is available from the pool, the getConnection method leases
the connection and returns it to the calling program.
Copyright: Copyright (c) 2003
Company: dmonix.org
| Constructor Summary | |
DMConnectionPool(java.lang.String url,
java.lang.String user,
java.lang.String password,
int initialSize)
Constructs a pool of the initial size. |
|
DMConnectionPool(java.lang.String url,
java.lang.String user,
java.lang.String password,
int initialSize,
boolean autoCommit)
Constructs a pool of the initial size. |
|
| Method Summary | |
void |
closeConnections()
This will close and remove all connections from the pool. |
java.sql.Connection |
getConnection()
The method searches for an available connection in the connection pool. |
void |
reapConnections()
The method will remove any hanging, dead connections. |
void |
removeConnection(DMConnection conn)
This will remove one connection from the pool. |
void |
returnConnection(DMConnection conn)
This will return a connection to the pool. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DMConnectionPool(java.lang.String url,
java.lang.String user,
java.lang.String password,
int initialSize,
boolean autoCommit)
throws java.sql.SQLException
url - The URL for the connectionuser - The user for the connectionpassword - The password for the connectioninitialSize - The initial size of the poolautoCommit - If the connections shall be autocommiting
java.sql.SQLException
public DMConnectionPool(java.lang.String url,
java.lang.String user,
java.lang.String password,
int initialSize)
throws java.sql.SQLException
url - The URL for the connectionuser - The suer for the connectionpassword - The password for the connectioninitialSize - The initial size of the pool
java.sql.SQLException| Method Detail |
public void reapConnections()
public void closeConnections()
public void removeConnection(DMConnection conn)
conn - The connection to remove
public java.sql.Connection getConnection()
throws java.sql.SQLException
wait().
If a connection is available from the pool, the getConnection method leases the connection and returns it to the calling program
java.sql.SQLExceptionpublic void returnConnection(DMConnection conn)
notify()
in order to release any thread waiting in the method getConnection()
conn - The connection to return
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||