net.toften.jlips.persist.db
Class DBDefaultStatement

java.lang.Object
  extended by net.toften.jlips.persist.db.DBAbstractStatement
      extended by net.toften.jlips.persist.db.DBDefaultStatement
All Implemented Interfaces:
DBStatement

public class DBDefaultStatement
extends DBAbstractStatement
implements DBStatement

SQL statement implementation using SQL standard notation This class extends the DBAbstractStatement class and overrides the specific SQL statements for the:

This is the default implementation of the DBStatement used by jLips if none is specified by the application.

Version:
$Revision: 1.1 $
Author:
thomas

Field Summary
 
Fields inherited from class net.toften.jlips.persist.db.DBAbstractStatement
expressions, myCon, primaryKeyValue, returnColumns, sourceTables
 
Fields inherited from interface net.toften.jlips.persist.db.DBStatement
DBS_DELETE_STM, DBS_INSERT_STM, DBS_SELECT_STM, DBS_UPDATE_STM
 
Constructor Summary
DBDefaultStatement()
           
 
Method Summary
protected  String buildDeleteStatement()
           
protected  String buildInsertStatement()
           
protected  String buildSelectStatement()
          Will build a standard SQL select statement
protected  String buildUpdateStatement()
           
 ResultSet doDelete()
           
 ResultSet doInsert()
           
 ResultSet doSelect()
          Must execute a select statement on the database.
 ResultSet doUpdate()
           
 void printStatement(String statementType)
           
 
Methods inherited from class net.toften.jlips.persist.db.DBAbstractStatement
addEqualExpression, addReturnColumn, addSourceTable, appendColumnNames, appendPrimaryKeyEquals, appendStrings, appendTableNames, prepareConnection, release, setPrimaryKeyValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.toften.jlips.persist.db.DBStatement
addEqualExpression, addReturnColumn, addSourceTable, release, setPrimaryKeyValue, toString
 

Constructor Detail

DBDefaultStatement

public DBDefaultStatement()
Method Detail

buildSelectStatement

protected String buildSelectStatement()
                               throws DBBadPropertiesException
Will build a standard SQL select statement

Returns:
String containing the select statement
Throws:
DBBadPropertiesException - if the provided properties are not correct or sufficient to create a select statement

buildUpdateStatement

protected String buildUpdateStatement()
                               throws DBBadPropertiesException
Throws:
DBBadPropertiesException

buildInsertStatement

protected String buildInsertStatement()
                               throws DBBadPropertiesException
Throws:
DBBadPropertiesException

buildDeleteStatement

protected String buildDeleteStatement()
                               throws DBBadPropertiesException
Throws:
DBBadPropertiesException

doSelect

public ResultSet doSelect()
                   throws SQLException,
                          DBBadPropertiesException
Description copied from interface: DBStatement
Must execute a select statement on the database. The implementation should build a select statement with the provided data and return the ResultSet

Using doSelect

DOCUMENT ME!

Specified by:
doSelect in interface DBStatement
Returns:
ResultSet with the data returned from the database
Throws:
SQLException - Exception thrown by the database driver
DBBadPropertiesException - if the properties are not correct or sufficent to execute a select statement

doUpdate

public ResultSet doUpdate()
                   throws SQLException,
                          DBBadPropertiesException
Specified by:
doUpdate in interface DBStatement
Throws:
SQLException
DBBadPropertiesException

doInsert

public ResultSet doInsert()
                   throws SQLException,
                          DBBadPropertiesException
Specified by:
doInsert in interface DBStatement
Throws:
SQLException
DBBadPropertiesException

doDelete

public ResultSet doDelete()
                   throws SQLException,
                          DBBadPropertiesException
Specified by:
doDelete in interface DBStatement
Throws:
SQLException
DBBadPropertiesException

printStatement

public void printStatement(String statementType)
                    throws DBBadPropertiesException
Specified by:
printStatement in interface DBStatement
Throws:
DBBadPropertiesException