|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DBStatement
This interface defines the methods for building a SQL statement. The interface provides a set of methods used to build up a SQL statement. The mehods use other jLips database description objects as parameters. The different parts of the statement are first set up:
DBConnectionFactory.getConnection()
method is used.
EntityFactory.init(Properties, Map)
method, passing in the name of the DBStatement implementing class.
The class is passed in the database properties parameter using the EntityFactory.EF_DB_STM_HAND
DBDefaultStatement
Field Summary | |
---|---|
static String |
DBS_DELETE_STM
|
static String |
DBS_INSERT_STM
|
static String |
DBS_SELECT_STM
|
static String |
DBS_UPDATE_STM
|
Method Summary | |
---|---|
void |
addEqualExpression(DBTableColumnInfo newColumn,
Object value)
Adds an equal expresion to the statement This applies to: Select statement (the values to be searched for) Update statement (the values to be changed) Delete statement (the values to be searched for) |
void |
addReturnColumn(DBTableColumnInfo newReturnColumn)
Adds a column from which data must be returned This applies to: Select statement If the table of the column has not been added as a source table, this method must add the table. |
void |
addSourceTable(DBTableInfo newTable)
Add a table to the statement This applies to: Select statement (data is returned from the table) Update statement (data is updated in the table) Insert statement (a record is inserted in the table) Delete statement (data is removed from the table) |
ResultSet |
doDelete()
|
ResultSet |
doInsert()
|
ResultSet |
doSelect()
Must execute a select statement on the database. |
ResultSet |
doUpdate()
|
void |
printStatement(String type)
|
void |
release()
When jLips is done with the statement, this method is called. |
void |
setPrimaryKeyValue(Object pKey)
Adds a primary key value to be used to locate a specific record This applies to: Update statement (record to be updated) Insert statement (primary key value of new record) Delete statement (record to be removed) |
String |
toString()
|
Field Detail |
---|
static final String DBS_SELECT_STM
static final String DBS_UPDATE_STM
static final String DBS_INSERT_STM
static final String DBS_DELETE_STM
Method Detail |
---|
void addSourceTable(DBTableInfo newTable)
newTable
- The table to addvoid addEqualExpression(DBTableColumnInfo newColumn, Object value)
newColumn
- The column to be testedvalue
- The value the column must be equal tovoid addReturnColumn(DBTableColumnInfo newReturnColumn)
newReturnColumn
- The column to return data fromvoid setPrimaryKeyValue(Object pKey)
newColumn
- The column to be testedvalue
- The value the column must be equal tovoid release()
ResultSet doSelect() throws SQLException, DBBadPropertiesException
doSelect
SQLException
- Exception thrown by the database driver
DBBadPropertiesException
- if the properties are not correct
or sufficent to execute a select statementResultSet doUpdate() throws SQLException, DBBadPropertiesException
SQLException
DBBadPropertiesException
ResultSet doInsert() throws SQLException, DBBadPropertiesException
SQLException
DBBadPropertiesException
ResultSet doDelete() throws SQLException, DBBadPropertiesException
SQLException
DBBadPropertiesException
String toString()
toString
in class Object
Object.toString()
void printStatement(String type) throws DBBadPropertiesException
DBBadPropertiesException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |