|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mentawai.db.AbstractConnectionHandler
org.mentawai.db.JNDIConnectionHandler
public class JNDIConnectionHandler
A connection handler that looks for a DataSource in a JNDI context. Use this class if you want to create a connection handler backed up by a DataSource which is bound to a JNDI context.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.mentawai.db.ConnectionHandler |
|---|
ConnectionHandler.Exec |
| Method Summary | |
|---|---|
void |
destroy()
Destroy the connection pool, closing and cleaning all connections. |
Object |
getBean()
|
Connection |
getConnection()
Returns a Connection to the database. |
static ConnectionHandler |
getInstance(String poolname)
Gets a ConnectionHandler with a DataSource bound to the JNDI context with the given name. |
String |
getStatus()
Print the status of this connection pool if any. |
void |
release(Connection conn)
Release this connection. |
| Methods inherited from class org.mentawai.db.AbstractConnectionHandler |
|---|
exec, getInstance, getType, onCleared, onCreated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Connection getConnection()
throws SQLException
ConnectionHandler
SQLException - if there were problems trying to acquire the connection.public String getStatus()
ConnectionHandler
public Object getBean()
throws InstantiationException
InstantiationExceptionpublic void release(Connection conn)
ConnectionHandler
conn - The connection to release.public static ConnectionHandler getInstance(String poolname)
poolname - The name with which the DataSource is bound to the JNDI context.
public void destroy()
ConnectionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||