|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.glite.data.common.helpers.DBManager
Class to manage database connection for the given pool.
Field Summary | |
protected javax.sql.DataSource |
m_dataSource
|
protected java.lang.String |
m_db_pool_name
|
Constructor Summary | |
DBManager(java.lang.String pool)
Create a manager for the given poolname. |
Method Summary | |
void |
cleanupResources(java.sql.Connection conn)
Cleanup a connection and return to pool. |
void |
cleanupResources(java.sql.ResultSet rs)
Cleanup ResultSet. |
void |
cleanupResources(java.sql.Statement st)
Cleanup a Statement. |
void |
commit(java.sql.Connection conn)
Commit a connection, throwing an exception if it fails. |
void |
commitRegardless(java.sql.Connection conn)
Commit a connection, but do not throw any exceptions if the commit fails. |
boolean |
commitWithResult(java.sql.Connection conn)
Commit a connection, returning true if it suceeded and false if it failed. |
java.sql.Statement |
createStatement(java.sql.Connection conn)
Create a basic statement object from the connection. |
java.sql.Connection |
getConnection(boolean autocommit)
Fetch a cvonnection from the pool. |
java.sql.PreparedStatement |
prepareStatement(java.sql.Connection conn,
java.lang.String sqlQuery)
Create a basic statement object from the connection. |
void |
rollback(java.sql.Connection conn)
Rollback a connectiopn and throw an excpetion if it fails. |
void |
rollbackRegardless(java.sql.Connection conn)
Rollback, but do not throw any exceptions if the rollback fails. |
boolean |
rollbackWithResult(java.sql.Connection conn)
Rollback a connection, returning true on success, false on failure. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final java.lang.String m_db_pool_name
protected final javax.sql.DataSource m_dataSource
Constructor Detail |
public DBManager(java.lang.String pool) throws DBException
pool
-
DBException
Method Detail |
public java.sql.Connection getConnection(boolean autocommit) throws DBException
autocommit
- Boolean flag for autocommit
DBException
- if a connection cannot be fetched.public java.sql.Statement createStatement(java.sql.Connection conn) throws DBException
conn
-
DBException
public java.sql.PreparedStatement prepareStatement(java.sql.Connection conn, java.lang.String sqlQuery) throws DBException
conn
-
DBException
public void rollback(java.sql.Connection conn) throws DBException
conn
-
DBException
public boolean rollbackWithResult(java.sql.Connection conn)
conn
-
public void rollbackRegardless(java.sql.Connection conn)
conn
- public void commit(java.sql.Connection conn) throws DBException
conn
-
DBException
public boolean commitWithResult(java.sql.Connection conn)
conn
-
public void commitRegardless(java.sql.Connection conn)
conn
- public void cleanupResources(java.sql.Connection conn)
conn
- public void cleanupResources(java.sql.Statement st)
st
- public void cleanupResources(java.sql.ResultSet rs)
rs
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |