|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dbforms.event.datalist.dao.AbstractDataSource org.dbforms.event.datalist.dao.DataSourceJDBC
public class DataSourceJDBC
Special implementation of DataSource. This is the default class and deals with JDBC Connections.
Constructor Summary | |
---|---|
DataSourceJDBC()
Creates a new DataSourceJDBC object. |
Method Summary | |
---|---|
protected void |
close()
Release all the resources holded by this datasource. |
int |
doDelete(DbEventInterceptorData interceptorData,
String keyValuesStr)
performs a delete in the DataSource |
int |
doInsert(DbEventInterceptorData interceptorData,
FieldValues fieldValues)
Performs an insert into the DataSource |
int |
doUpdate(DbEventInterceptorData interceptorData,
FieldValues fieldValues,
String keyValuesStr)
Performs an update into the DataSource |
protected int |
findStartRow(String startRow)
Find the first row of the internal data vector. |
protected Object[] |
getRow(int i)
Get the requested row as array of objects. |
protected int |
getRowCount()
DOCUMENT ME! |
protected boolean |
hasMore(int i)
return true if there are more records to fetch then the given record number |
boolean |
isCalcRowCount()
DOCUMENT ME! |
protected void |
open()
Open this datasource and initialize its resources. |
void |
setCalcRowCount(boolean calcRowCount)
DOCUMENT ME! |
protected void |
setConnection(Connection con,
String dbConnectionName)
set the connection parameter for the DataSouce. virtual method, if you need the connection data you must override the method In this special case we need our own connection to save it in the session. |
void |
setSelect(FieldValue[] filterConstraint,
FieldValue[] orderConstraint,
String sqlFilter,
FieldValue[] sqlFilterParams)
Set the filterConstraint and orderConstraint used to build the SQL Select condition. |
void |
setSelect(String tableList,
String whereClause)
Set the tableList and whererClause attributes used to build the SQL Select condition. |
protected int |
size()
Get the size of the data vector. |
Methods inherited from class org.dbforms.event.datalist.dao.AbstractDataSource |
---|
deleteBlobFilesFromDisk, getCurrent, getFirst, getLast, getNext, getPrev, getResultSetVector, getTable, saveBlobFilesToDisk, setTable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataSourceJDBC()
Method Detail |
---|
public void setCalcRowCount(boolean calcRowCount)
calcRowCount
- The calcRowCount to set.public boolean isCalcRowCount()
public void setSelect(String tableList, String whereClause)
setSelect
in class AbstractDataSource
tableList
- the table list stringwhereClause
- the SQL where clause stringpublic void setSelect(FieldValue[] filterConstraint, FieldValue[] orderConstraint, String sqlFilter, FieldValue[] sqlFilterParams)
setSelect
in class AbstractDataSource
filterConstraint
- FieldValue array used to build a cumulation of rules for
filtering fields.orderConstraint
- FieldValue array used to build a cumulation of rules for
ordering (sorting) and restricting fields.sqlFilter
- sql condition to add to where clausesqlFilterParams
- list of FieldValues to fill the sqlFilter withpublic int doDelete(DbEventInterceptorData interceptorData, String keyValuesStr) throws SQLException
doDelete
in class AbstractDataSource
interceptorData
- DOCUMENT ME!keyValuesStr
- keyValueStr to the row to update SQLException
public int doInsert(DbEventInterceptorData interceptorData, FieldValues fieldValues) throws SQLException
doInsert
in class AbstractDataSource
interceptorData
- DOCUMENT ME!fieldValues
- FieldValues to insert
SQLException
public int doUpdate(DbEventInterceptorData interceptorData, FieldValues fieldValues, String keyValuesStr) throws SQLException
doUpdate
in class AbstractDataSource
interceptorData
- DOCUMENT ME!fieldValues
- FieldValues to updatekeyValuesStr
- keyValueStr to the row to update SQLException
protected void setConnection(Connection con, String dbConnectionName)
setConnection
in class AbstractDataSource
con
- the JDBC Connection objectdbConnectionName
- 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!)protected final Object[] getRow(int i) throws SQLException
getRow
in class AbstractDataSource
i
- the row number
SQLException
- if any error occursprotected final void close()
close
in class AbstractDataSource
protected final int findStartRow(String startRow) throws SQLException
findStartRow
in class AbstractDataSource
startRow
- the string identifying the initial row
SQLException
- if any error occursprotected final boolean hasMore(int i) throws SQLException
hasMore
in class AbstractDataSource
i
- index of last fetched row.
SQLException
protected void open() throws SQLException
open
in class AbstractDataSource
SQLException
- if any error occursprotected final int size() throws SQLException
size
in class AbstractDataSource
SQLException
- if any error occursprotected int getRowCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |