|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openware.job.data.BaseDBA
Abstract base class for all database adaptors. Each database adaptor provides the actual SQL queries, translated for each database, that are required by JOB.
Field Summary | |
protected Converter |
converter
The object that holds the type mapping for each database. |
protected boolean |
debugMode
|
Constructor Summary | |
protected |
BaseDBA(Converter converter)
|
protected |
BaseDBA(Converter converter,
boolean debugMode)
|
Method Summary | |
abstract void |
create(TableRow shell,
java.sql.Connection conn)
Create a new row in the database for this TableRow object. |
protected void |
dbaccessComplete(java.sql.Connection conn,
java.sql.Statement stmt,
java.sql.ResultSet rs)
Clean up a database connection, statement, and/or resultset. |
void |
debug(java.lang.String msg)
|
abstract java.util.Collection |
findBy(TableRow shell,
java.sql.Connection conn,
java.lang.String whereClause,
java.lang.String[] joinTables)
Find TableRow s with the given where clause. |
abstract void |
load(TableRow shell,
java.sql.Connection conn)
Load values from the underlying database to the internal values for this TableRow object. |
abstract MetaData |
loadMetaData(java.sql.Connection conn)
Load the MetaData object to the database. |
abstract void |
remove(TableRow shell,
java.sql.Connection conn)
Remove the database row for this TableRow object. |
abstract void |
store(TableRow shell,
java.sql.Connection conn)
Store the data for this TableRow to the underlying
database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Converter converter
protected boolean debugMode
Constructor Detail |
protected BaseDBA(Converter converter)
protected BaseDBA(Converter converter, boolean debugMode)
Method Detail |
public void debug(java.lang.String msg)
protected void dbaccessComplete(java.sql.Connection conn, java.sql.Statement stmt, java.sql.ResultSet rs)
conn
- The database connection to close. null
if you don't want to close a connection.stmt
- The database statement to close. null
if you don't want to close a statement.rs
- The database result set to close. null
if you don't want to close a result set.public abstract void create(TableRow shell, java.sql.Connection conn) throws java.sql.SQLException, TableRowException
TableRow
object.
A primary key is generated in this method for the TableRow
object. The primary key can be accessed via the getPrimaryKey
method. This method returns a String
representation of the
primary key.conn
- The connection to use to access the database.java.sql.SQLException
- if an error occurs accessing the database.TableRowException
- if no row is added to the databse. That is,
if 'executeUpdate' returns a count of 0.public abstract void remove(TableRow shell, java.sql.Connection conn) throws java.sql.SQLException
TableRow
object.conn
- The database connection to use for the query.java.sql.SQLException
- if there is an error accessing the database.public abstract java.util.Collection findBy(TableRow shell, java.sql.Connection conn, java.lang.String whereClause, java.lang.String[] joinTables) throws java.sql.SQLException
TableRow
s with the given where clause.public abstract void store(TableRow shell, java.sql.Connection conn) throws java.sql.SQLException, TableRowException, DataIntegrityException
TableRow
to the underlying
database. First checks that the object version number of the
object matches that in the database table row.conn
- The connection to the database.java.sql.SQLException
- if there is an error accessing the database.TableRowException
- if no row is added to the databse. That is,
if 'executeUpdate' returns a count of 0.DataIntegrityException
- if the object version number of the
TableRow
object doesn't match that in the
database table row.public abstract void load(TableRow shell, java.sql.Connection conn) throws java.sql.SQLException
TableRow
object. You must set the primary
key for the TableRow
object before calling this method.
NOTE: A side-effect is that the internal values for
the TableRow
are set to those from the database table
row with the primary key set in a previous call to setPrimaryKey
.
conn
- The connection to the database.java.sql.SQLException
- if there is an error accessing the database.public abstract MetaData loadMetaData(java.sql.Connection conn) throws java.lang.Exception
MetaData
object to the database.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |