|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.adhi.adhij.DataAccessObject
public abstract class DataAccessObject
The Data Access Object. This class connects to the data server and executes queries.
Constructor Summary | |
---|---|
DataAccessObject()
|
Method Summary | |
---|---|
void |
closeConnection()
close the database connection |
RowSet |
createRowSet(java.sql.ResultSet rs)
create a row set out of a result set |
java.sql.Statement |
createStatement()
create a statement |
void |
finallyClose(java.sql.ResultSet result,
java.sql.Statement stmt,
java.lang.Exception exception)
This is a clean up operation. |
java.sql.PreparedStatement |
getPreparedStmt(java.lang.String query)
create a prepared statement using the connection |
void |
openConnection()
opens the database connection |
void |
openConnection(java.lang.String dsJNDI)
open a database connection using a jndi name of a data source |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataAccessObject()
Method Detail |
---|
public void closeConnection() throws java.sql.SQLException
java.sql.SQLException
- when the connection cannot he closedpublic void finallyClose(java.sql.ResultSet result, java.sql.Statement stmt, java.lang.Exception exception) throws DataException
result
- the result setstmt
- the statementexception
- if there is an exception already happened
DataException
- when the clean up operation failspublic void openConnection() throws java.lang.Exception
java.lang.Exception
- if the database connection cannot be openedpublic void openConnection(java.lang.String dsJNDI) throws DataException
dsJNDI
- the JNDI name of a data source
DataException
- when the connection cannot be openedpublic RowSet createRowSet(java.sql.ResultSet rs) throws java.sql.SQLException
rs
- the result set
java.sql.SQLException
- if the rowset cannot be createdpublic java.sql.PreparedStatement getPreparedStmt(java.lang.String query) throws java.sql.SQLException
query
- the query string
java.sql.SQLException
- when the prepared statement cannot be createdpublic java.sql.Statement createStatement() throws java.sql.SQLException
java.sql.SQLException
- if the statement cannot be created
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |