|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbforms.event.datalist.dao.DataSourceFactory
public class DataSourceFactory
Factory class to generate different DataSources. datasource is attribute of table class and can be changed in dbforms-config. Default class is
Constructor Summary | |
---|---|
DataSourceFactory(String dbConnectionName,
Connection connection,
Table table)
Creates a new DataSourceFactory object. |
Method Summary | |
---|---|
void |
close()
Close the underlying dataHandler. |
int |
doDelete(DbEventInterceptorData interceptorData,
String keyValuesStr)
Perform a delete operation into the underlying dataSource. |
int |
doInsert(DbEventInterceptorData interceptorData,
FieldValues fieldValues)
Perform an insert operation into the underlying dataSource. |
int |
doUpdate(DbEventInterceptorData interceptorData,
FieldValues fieldValues,
String keyValuesStr)
Perform an update operation into the underlying dataSource. |
ResultSetVector |
getCurrent(DbEventInterceptorData interceptorData,
String position,
int count)
Return a resultSetVector object containing count records starting from the input position |
AbstractDataSource |
getDataHandler()
returns the internal DataSource element |
ResultSetVector |
getFirst(DbEventInterceptorData interceptorData,
int count)
Return a resultSetVector object containing the first count records. |
ResultSetVector |
getLast(DbEventInterceptorData interceptorData,
int count)
Return a resultSetVector object containing the last count records. |
ResultSetVector |
getNext(DbEventInterceptorData interceptorData,
String position,
int count)
Return a resultSetVector object containing the next count records starting from the input position + count records. |
ResultSetVector |
getPrev(DbEventInterceptorData interceptorData,
String position,
int count)
Return a resultSetVector object containing the previous count records starting from the input position + count records. |
void |
setSelect(FieldValue[] filterConstraint,
FieldValue[] orderConstraint,
String sqlFilter,
FieldValue[] sqlFilterParams)
Sets the select data for this dataSource |
void |
setSelect(String tableList,
String whereClause)
Sets the select data for this dataSource for free form selects. default methods just raises an exception |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSourceFactory(String dbConnectionName, Connection connection, Table table) throws SQLException
dbConnectionName
- name of the used db connection. Can be used to
get an own db connection, e.g. to hold it during the session
(see DataSourceJDBC for example!)con
- the JDBC Connection objecttable
- the input table
SQLException
- if any error occursMethod Detail |
---|
public ResultSetVector getCurrent(DbEventInterceptorData interceptorData, String position, int count) throws SQLException
position
- the current table positioncount
- number of records to fetch
SQLException
- if any error occurspublic AbstractDataSource getDataHandler()
public ResultSetVector getFirst(DbEventInterceptorData interceptorData, int count) throws SQLException
count
- number of records to fetch
SQLException
- if any error occurspublic ResultSetVector getLast(DbEventInterceptorData interceptorData, int count) throws SQLException
count
- number of records to fetch
SQLException
- if any error occurspublic ResultSetVector getNext(DbEventInterceptorData interceptorData, String position, int count) throws SQLException
position
- the current table positioncount
- number of records to fetch
SQLException
- if any error occurspublic ResultSetVector getPrev(DbEventInterceptorData interceptorData, String position, int count) throws SQLException
position
- the current table positioncount
- number of records to fetch
SQLException
- if any error occurspublic void setSelect(FieldValue[] filterConstraint, FieldValue[] orderConstraint, String sqlFilter, FieldValue[] sqlFilterParams)
filterConstraint
- FieldValue array used to restrict a set in a
resultsetorderConstraint
- FieldValue array used to build a cumulation of
rules for ordering (sorting)sqlFilter
- sql condition to add to where clausesqlFilterParams
- DOCUMENT ME!public void setSelect(String tableList, String whereClause) throws SQLException
tableList
- the list of tables involved into the querywhereClause
- free-form whereClause to be appended to query
SQLException
public void close()
public int doDelete(DbEventInterceptorData interceptorData, String keyValuesStr) throws SQLException
con
- DOCUMENT ME!keyValuesStr
- the key value identifying the record to delete
SQLException
- if any error occurspublic int doInsert(DbEventInterceptorData interceptorData, FieldValues fieldValues) throws SQLException
con
- DOCUMENT ME!fieldValues
- the field values to insert
SQLException
- if any error occurspublic int doUpdate(DbEventInterceptorData interceptorData, FieldValues fieldValues, String keyValuesStr) throws SQLException
con
- DOCUMENT ME!fieldValues
- the field values to updatekeyValuesStr
- the key value identifying the record to update
SQLException
- if any error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |