|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jso.sql.NoPool
Manages a pool of database connections.
Constructor Summary | |
NoPool()
Constructs the pool. |
Method Summary | |
java.sql.Connection |
borrowConnection()
Borrows a connection from the pool. |
int |
capacity()
Returns the maximum pool size. |
void |
close()
Closes the pool. |
protected void |
finalize()
Cleans the pool before it's garbage collected. |
ConnectionPoolInfo |
getPoolInfo()
Gets connection pool information. |
int |
idle()
Returns the number of idle connections. |
int |
inUse()
Returns the number of used connections. |
boolean |
isOpen()
Indicates if the pool is open. |
void |
open(java.lang.String anUrl,
java.lang.String anUser,
java.lang.String aPassword)
Opens the pool. |
void |
open(java.lang.String aDriverClass,
java.lang.String anUrl,
java.lang.String anUser,
java.lang.String aPassword)
Opens the pool. |
void |
returnConnection(java.sql.Connection aConnection)
Returns a connection to the pool. |
int |
size()
Returns the current pool size. |
java.lang.String |
url()
Returns the current database url. |
java.lang.String |
user()
Returns the current database user. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NoPool() throws java.lang.IllegalArgumentException
Method Detail |
public java.lang.String url()
public java.lang.String user()
public int capacity()
capacity
in interface ConnectionPoolInfo
public int size()
size
in interface ConnectionPoolInfo
public int idle()
idle
in interface ConnectionPoolInfo
public int inUse()
inUse
in interface ConnectionPoolInfo
public void open(java.lang.String anUrl, java.lang.String anUser, java.lang.String aPassword) throws java.sql.SQLException
open
in interface ConnectionPool
anUrl
- A database url of the form jdbc:subprotocol:subname
.anUser
- The database user on whose behalf the connections will be made.aPassword
- The user's password.
java.sql.SQLException
public void open(java.lang.String aDriverClass, java.lang.String anUrl, java.lang.String anUser, java.lang.String aPassword) throws java.sql.SQLException
open
in interface ConnectionPool
aDriverClass
- Fully qualified name for the JDBC driver.anUrl
- A database url of the form jdbc:subprotocol:subname
.anUser
- The database user on whose behalf the connections will be made.aPassword
- The user's password.
java.sql.SQLException
public java.sql.Connection borrowConnection() throws java.sql.SQLException
borrowConnection
in interface ConnectionPool
java.sql.SQLException
public void returnConnection(java.sql.Connection aConnection) throws java.sql.SQLException
returnConnection
in interface ConnectionPool
aConnection
- A connection previously borrowed from the database.
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface ConnectionPool
java.sql.SQLException
public boolean isOpen()
isOpen
in interface ConnectionPool
true
if the pool is open; false
otherwise.protected void finalize() throws java.lang.Throwable
java.lang.Throwable
public ConnectionPoolInfo getPoolInfo()
getPoolInfo
in interface ConnectionPool
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |