|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.peter.db.DBConHandler
This class handles the queries to the database. It uses the a pool of connections in order to set up the needed connection.
Constructor Summary | |
DBConHandler(DBConPool pool,
java.sql.Connection con)
Constructor for this class |
Method Summary | |
void |
closeConnection()
Closes this handler's database connection. |
void |
countDown()
Starts counting down until the maximum time threashold is reached |
DBMatrix[] |
executeNQueries(java.lang.String[] queries)
Executes a selection of N queries in the database |
DBMatrix |
executePreparedStatement(java.lang.String query,
java.lang.Object[] obj)
Executes a selection query in the database. |
DBMatrix |
executeQuery(java.lang.String query)
Executes a selection query in the database. |
java.sql.ResultSet |
executeQueryRS(java.lang.String query)
Executes a selection query in the database. |
int |
executeUpdate(java.lang.String query)
Excutes an update query in the database. |
int |
executeUpdatePS(java.lang.String query,
java.lang.Object[] obj)
Excutes an update query in the database. |
java.sql.Connection |
getConnection()
This method is used when it's necessary to retrieve the Connection and handle it by yourself. |
void |
setReleased()
Sets the released flag indicating that this handler is released |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DBConHandler(DBConPool pool, java.sql.Connection con)
pool
- The pool that contains this Handler.con
- The connection for this Handler.Method Detail |
public int executeUpdate(java.lang.String query) throws java.sql.SQLException
query
- The query to executejava.sql.SQLException
- If a SQLException was thrownpublic int executeUpdatePS(java.lang.String query, java.lang.Object[] obj) throws java.sql.SQLException
query
- The query to executeobj
- An Array of Objects to be inserted in the SQL-queryjava.sql.SQLException
- If a SQLException was thrownpublic DBMatrix executeQuery(java.lang.String query) throws java.sql.SQLException
query
- The query to executejava.sql.SQLException
- If a SQLException was thrownpublic java.sql.ResultSet executeQueryRS(java.lang.String query) throws java.sql.SQLException
query
- The query to executejava.sql.SQLException
- If a SQLException was thrownpublic DBMatrix executePreparedStatement(java.lang.String query, java.lang.Object[] obj) throws java.sql.SQLException
query
- The query to executeobj
- An Array of Objects to be inserted in the SQL-queryjava.sql.SQLException
- If a SQLException was thrownpublic DBMatrix[] executeNQueries(java.lang.String[] queries) throws java.sql.SQLException
queries
- The queries to executejava.sql.SQLException
- If a SQLException was thrownpublic java.sql.Connection getConnection()
This method is used when it's necessary to retrieve the Connection and handle it by yourself.
public void closeConnection() throws java.sql.SQLException
java.sql.SQLException
- If a SQLException was thrownpublic void countDown()
DBConHandler.WaitAndRelease
public void setReleased()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |