|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
jrun.sql.pool.JDBCPool
JDBCPool is an ObjectPool of JDBC connection objects. It is also a javax.sql.ConnectionEventListener, so it can respond to events fired by the XAConnection implementation, JRunConnection.
| Field Summary | |
protected SQLCache |
sqlcache
|
| Constructor Summary | |
JDBCPool(PoolMetaData metad)
|
|
| Method Summary | |
void |
checkCredentials(java.lang.String username,
java.lang.String password)
|
protected java.lang.Object |
checkOut(java.lang.String username,
java.lang.String password)
Checkout cycles through the available objects and returns the first valid object it finds. |
void |
cleanPooledStatements(java.sql.Connection con)
Cleans PreparedStatements that have been produced by this Connection |
void |
closeAllResources()
Overriden in order to ensure that JNDI resources are disposed of properly. |
static void |
closeConnection(java.sql.Connection con)
|
static void |
closeResources(java.sql.Connection con,
java.sql.Statement statement,
java.sql.ResultSet resultset)
Static method that closes the Connection, Statement and ResultSets in one place. |
static void |
closeResources(java.sql.Statement statement,
java.sql.ResultSet resultSet)
Static method that closes the statement and result sets in one place; this is here as a convenience to shorten the finally block in statements. |
static void |
closeResultSet(java.sql.ResultSet rs)
This method closes the given resultset. |
static void |
closeStatement(java.sql.Statement statement)
Closes the given statement. |
void |
connectionClosed(javax.sql.ConnectionEvent event)
Responds to a ConnectionClosed ConnectionEvent. |
void |
connectionErrorOccurred(javax.sql.ConnectionEvent event)
Responds to an error event. |
protected java.lang.Object |
create()
Creates a physical Connection and JRunConnection wrapper for it. |
protected java.lang.Object |
create(java.lang.String username,
java.lang.String password)
Creates a physical Connection and JRunConnection wrapper for it using username and password passed in. |
void |
deployDataSource()
|
boolean |
equals(java.lang.Object o)
|
protected void |
expire(java.lang.Object o)
Closes both the pooled and the physical database connection. |
SQLCache |
getCache()
|
javax.sql.DataSource |
getDataSource()
|
java.lang.String |
getDriver()
|
int |
getIsolationLevel()
|
java.lang.String |
getPassword()
|
java.lang.String |
getTransactionDomain()
|
java.lang.String |
getURL()
|
java.lang.String |
getUserName()
|
protected boolean |
holdingLock(java.lang.Object o)
|
void |
init()
|
void |
initEncrypter()
|
boolean |
isDataSourceDeployed()
|
boolean |
isUsingNativeResults()
|
protected boolean |
matchSecurityInfo(java.lang.String username,
java.lang.String password,
java.lang.Object conn)
Verifies if username and password match with the one from the connection Neither username nor password can be null, returns false if either one is null |
int |
numPooledStatements(java.lang.String sql)
|
int |
numStatementPools()
|
void |
refreshCache()
Force the cache to refresh. |
java.sql.Connection |
requestConnection()
Retrieves a JRunConnection and returns its Handle. |
java.sql.Connection |
requestConnection(java.lang.String username,
java.lang.String password)
Retrieves a JRunConnection and returns its Handle. |
java.sql.PreparedStatement |
requestPooledStatement(java.lang.String sql)
|
void |
returnConnection(JRunConnection pcon)
Returns a JRunConnection to the pool. |
void |
returnPooledStatement(JRunPreparedStatement ps)
Retuns a PreparedStatement to the statement pool |
void |
setCache(SQLCache cache)
Associates a SQLCache with this pool. |
void |
setDataSource(JRunDataSource ds)
Associates a DataSource view with this pool. |
void |
undeployDataSource()
|
boolean |
usingCache()
Determine whether or not this pool is using a SQLCache (configured in poolman.props and disabled by default). |
protected boolean |
validate(java.lang.Object o)
|
boolean |
validateJRunConnection(JRunConnection jcon)
|
| Field Detail |
protected SQLCache sqlcache
| Constructor Detail |
public JDBCPool(PoolMetaData metad)
| Method Detail |
public void init()
throws java.lang.Exception
public void setDataSource(JRunDataSource ds)
public javax.sql.DataSource getDataSource()
public void deployDataSource()
public void undeployDataSource()
public boolean isDataSourceDeployed()
public void setCache(SQLCache cache)
public SQLCache getCache()
public void initEncrypter()
public boolean usingCache()
public void refreshCache()
public java.lang.String getDriver()
public java.lang.String getURL()
public java.lang.String getUserName()
public java.lang.String getPassword()
public int getIsolationLevel()
public boolean isUsingNativeResults()
public java.lang.String getTransactionDomain()
public boolean equals(java.lang.Object o)
public void checkCredentials(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
public void connectionClosed(javax.sql.ConnectionEvent event)
public void connectionErrorOccurred(javax.sql.ConnectionEvent event)
protected java.lang.Object checkOut(java.lang.String username,
java.lang.String password)
throws java.lang.Exception
protected boolean holdingLock(java.lang.Object o)
protected java.lang.Object create()
throws java.sql.SQLException
protected java.lang.Object create(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
public boolean validateJRunConnection(JRunConnection jcon)
protected boolean matchSecurityInfo(java.lang.String username,
java.lang.String password,
java.lang.Object conn)
protected boolean validate(java.lang.Object o)
protected void expire(java.lang.Object o)
public java.sql.Connection requestConnection()
throws java.sql.SQLException
public java.sql.Connection requestConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
public void returnConnection(JRunConnection pcon)
public java.sql.PreparedStatement requestPooledStatement(java.lang.String sql)
public void returnPooledStatement(JRunPreparedStatement ps)
public void cleanPooledStatements(java.sql.Connection con)
throws java.sql.SQLException
public int numStatementPools()
public int numPooledStatements(java.lang.String sql)
public void closeAllResources()
public static void closeResources(java.sql.Connection con,
java.sql.Statement statement,
java.sql.ResultSet resultset)
public static void closeResources(java.sql.Statement statement,
java.sql.ResultSet resultSet)
statement - the statement to be closedresultSet - the resultSet to be closedpublic static void closeConnection(java.sql.Connection con)
public static void closeStatement(java.sql.Statement statement)
statement - the statement to be closed. may be nullpublic static void closeResultSet(java.sql.ResultSet rs)
rs - the ResultSet to be closed. may be null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||