org.enableit.db
Class DBStatement

java.lang.Object
  |
  +--org.enableit.db.DBStatement
Direct Known Subclasses:
DBInsert, DBQuery, DBUpdate

public abstract class DBStatement
extends java.lang.Object

Common ancestor for both queries and updates.

Author:
Tim Stephenson

Field Summary
static java.lang.String ABOUT
          CVS info about this class and its current version
protected  java.util.List cols
           
protected static java.lang.String SPACE
           
protected  java.util.List vals
           
 
Constructor Summary
DBStatement()
          Default Constructor
DBStatement(java.lang.String baseSql)
          Construct instance and set the base SQL statement.
 
Method Summary
 void addFilter(org.enableit.db.DBFilter filter)
           
protected  void appendWhereClause(java.lang.String s)
           
 java.lang.String getBaseSql()
           
 java.util.Iterator getFilterIterator()
           
protected  java.lang.Object getParam(org.enableit.db.beans.Column col, java.lang.Object val)
           
 java.util.List getParameters()
           
 java.lang.String getSql()
           
protected  java.lang.String getWhereClause()
           
 void setBaseSql(java.lang.String baseSql)
           
 void setDateFormat(java.text.DateFormat fmt)
           
 void setDateTimeFormat(java.text.DateFormat fmt)
           
 void setTimeFormat(java.text.DateFormat fmt)
           
protected  void setWhereClause(java.lang.String whereClause)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACE

protected static final java.lang.String SPACE
See Also:
Constant Field Values

ABOUT

public static final java.lang.String ABOUT
CVS info about this class and its current version

See Also:
Constant Field Values

cols

protected java.util.List cols

vals

protected java.util.List vals
Constructor Detail

DBStatement

public DBStatement()
Default Constructor


DBStatement

public DBStatement(java.lang.String baseSql)
Construct instance and set the base SQL statement.

Parameters:
baseSql - The underlying SQL statement.
Method Detail

getBaseSql

public java.lang.String getBaseSql()
Returns:
baseSql The base SQL.

setBaseSql

public void setBaseSql(java.lang.String baseSql)
Parameters:
baseSql - The base SQL.

setDateFormat

public void setDateFormat(java.text.DateFormat fmt)

setTimeFormat

public void setTimeFormat(java.text.DateFormat fmt)

setDateTimeFormat

public void setDateTimeFormat(java.text.DateFormat fmt)

getFilterIterator

public java.util.Iterator getFilterIterator()
Returns:
filters Iterator over the DBFilters in this statement.

addFilter

public void addFilter(org.enableit.db.DBFilter filter)
Parameters:
filter - Additional where clause.

getSql

public java.lang.String getSql()
Returns:
SQL with placeholders for any parameters.

appendWhereClause

protected void appendWhereClause(java.lang.String s)

getParameters

public java.util.List getParameters()
Returns:
List of variables to bind to the placeholders in the SQL.

getParam

protected java.lang.Object getParam(org.enableit.db.beans.Column col,
                                    java.lang.Object val)

setWhereClause

protected void setWhereClause(java.lang.String whereClause)

getWhereClause

protected java.lang.String getWhereClause()


Copyright © 1999-2004 enableIT.org. All Rights Reserved.