All Packages Class Hierarchy This Package Previous Next Index
Class JProjects.eab.data.DAManager
java.lang.Object
|
+----JProjects.eab.data.DAManager
- public abstract class DAManager
- extends Object
- implements OnThreadActionExecutor
This abstract class defines the standard interface for a data access class.
It provides access to a collection of rows from a table, and facilitates
manipulation of rows by using a database cursor.
- Author:
- Alexander Jaremenko < jarem@isb.gomel.by >
-
_executeAction(String, Object[])
-
-
_handleException(Exception)
-
-
addManagerCompleteListener(ManagerCompleteListener)
- Use this method to register a listener for method complete events.
-
addPropertyChangeListener(PropertyChangeListener)
- Use this method to register a listener for property changes.
-
append(int)
- Use this method to append the specified number of rows from the datastore
to the current internal sequence that you have created by
calling the fill method.
-
append(Vector, int)
- Use this method to append the specified number of rows from the datastore
to the passed-in Vector object.
-
cancel()
- This method cancels the SQL statement that is currently running.
-
close()
- This method closes the cursor if one is open.
-
deleteFetched()
- This method, when implemented in a subclass (such as <class>
Manager, which is generated by Data Access Builder), deletes the
row corresponding to the fetched object, if there is one.
-
elementAsDataAccessObject()
-
-
fetchNext()
- This method fetches the attributes from the next row into the cached
object (a default object is provided).
-
fetchNextInto(DataAccessObject)
- This method fetches the attributes from the next row into a
PersistentObject object.
-
fill(int)
- This method fetches the specified number of rows into the cached
vector, starting at the row after the last-fetched row.
-
fill(Vector, int)
- This method fetches the specified number of rows into the passed-in
Vector object, starting at the row after the last-fetched row.
-
getCurrentDatastore()
- This method is to be implemented in a subclass.
-
getMaxRows()
-
-
getObjectsDatastore()
-
-
getQueryTimeout()
-
-
isAfterLastRow()
- This method tells you whether last row was already fetched.
-
isAsynchronous()
-
-
isBusy()
-
-
isFetched()
- This method tells you whether the current row has been fetched into the
cached object.
-
isOpen()
- This method tells you whether a cursor is open and usable.
-
items()
-
-
open(String)
- This abstract method can be implemented in a extending class, as it is
in the classes generated by the Data Access Builder, to
open a cursor for the rows specified in the passed-in SQL suffix.
-
prepareOpen(String, Object[], int[])
- Use this method when You want prepare and execute parametrized statement.
-
removeManagerCompleteListener(ManagerCompleteListener)
- Use this method to remove the method complete listener on the manager
object.
-
removePropertyChangeListener(PropertyChangeListener)
- Use this method to remove the property change listener on the manager
object.
-
select(String)
- This abstract method can be implemented in an extending class so that
it opens a cursor, retrieves rows as specified in the
passed-in SQL predicate into a collection, and closes the cursor.
-
setAsynchronous(boolean)
- This method lets you set whether the database methods are run on a
background thread.
-
setMaxRows(int)
- Use this method to set the maximum number of rows that a result set can
contain.
-
setObjectsDatastore(DatastoreJDBC)
- This method sets the datastore associated with the current manager object
to the DatastoreJDBC object passed in.
-
setQueryTimeout(int)
- Use this method to set the maximum time (in seconds) that the database
driver will wait for a query to be run.
-
updateFetched()
- This method, when implemented in a subclass (such as <class>
Manager, which is generated by Data Access Builder), updates the
row corresponding to the fetched object, if there is one,
with the cached object's attributes.
_executeAction
public void _executeAction(String acnN,
Object params[]) throws Exception
_handleException
public void _handleException(Exception ex)
addManagerCompleteListener
public void addManagerCompleteListener(ManagerCompleteListener l)
- Use this method to register a listener for method complete events.
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
- Use this method to register a listener for property changes.
append
public int append(int rowC) throws DAException
- Use this method to append the specified number of rows from the datastore
to the current internal sequence that you have created by
calling the fill method.
- Parameters:
- rowC - - number of rows to retrieve from DB.
- Returns:
- - number of rows retrieved.
- Throws: DAException
- - when data access error occurs.
append
public int append(Vector v,
int rowC) throws DAException
- Use this method to append the specified number of rows from the datastore
to the passed-in Vector object.
- Parameters:
- v - - vector for storing of retrieved rows.
- rowC - - number of rows to retrieve from DB.
- Returns:
- - number of rows retrieved.
- Throws: DAException
- - when data access error occurs.
cancel
public void cancel() throws DAException
- This method cancels the SQL statement that is currently running.
- Throws: DAException
- - when data access error occurs.
close
public void close() throws DAException
- This method closes the cursor if one is open.
- Throws: DAException
- - when data access error occurs.
deleteFetched
public void deleteFetched() throws DAException
- This method, when implemented in a subclass (such as <class>
Manager, which is generated by Data Access Builder), deletes the
row corresponding to the fetched object, if there is one.
- Throws: DAException
- - when data access error occurs.
prepareOpen
public void prepareOpen(String sqlSuffix,
Object vals[],
int types[]) throws DAException
- Use this method when You want prepare and execute parametrized statement.
- Parameters:
- sqlSuffix - - where clause of the statement.
- vals - - array of values of the parameters. Length of the array must
correspond to the number of '?' placeholders in the statement.
- types - - array of type codes for the parameters of the statement.
Length of the array must be equal to the
vals
. Code values are
defined in the java.sql.Types
.
- Throws: DAException
- - when data access error occurs.
- See Also:
- Types
elementAsDataAccessObject
public DataAccessObject elementAsDataAccessObject()
- Returns:
- - the current cached object (that is, the
currently-fetched row).
fetchNext
public boolean fetchNext() throws DAException
- This method fetches the attributes from the next row into the cached
object (a default object is provided).
- Returns:
- - true if fetch was OK, false - if the last row had been fetched.
- Throws: DAException
- - when data access error occurs.
fetchNextInto
public boolean fetchNextInto(DataAccessObject o) throws DAException
- This method fetches the attributes from the next row into a
PersistentObject object.
- Parameters:
- o - - PersistentObject where to fetch current row.
- Returns:
- - true if fetch was OK, false - if the last row had been fetched.
- Throws: DAException
- - when data access error occurs.
fill
public int fill(int rowC) throws DAException
- This method fetches the specified number of rows into the cached
vector, starting at the row after the last-fetched row.
- Parameters:
- rowC - - number of rows to fetch.
- Returns:
- - number of rows fetched.
- Throws: DAException
- - when data access error occurs.
fill
public int fill(Vector v,
int rowC) throws DAException
- This method fetches the specified number of rows into the passed-in
Vector object, starting at the row after the last-fetched row.
- Parameters:
- v - - vector for storing fetched rows.
- rowC - - number of rows to fetch.
- Returns:
- - number of rows fetched.
- Throws: DAException
- - when data access error occurs.
getCurrentDatastore
public abstract DatastoreJDBC getCurrentDatastore()
- This method is to be implemented in a subclass.
- Returns:
- - the object's current datastore.
getObjectsDatastore
public DatastoreJDBC getObjectsDatastore()
- Returns:
- - the datastore object associated with the current object.
getQueryTimeout
public int getQueryTimeout()
- Returns:
- - the setting for the maximum length of time (in
seconds) that the database driver will wait for a query to run.
getMaxRows
public int getMaxRows()
- Returns:
- - the setting for the maximum number of rows that
the result set of a select or open query can contain.
isAsynchronous
public boolean isAsynchronous()
- Returns:
- true if the current object is in asynchronous mode.
isBusy
public boolean isBusy()
- Returns:
- true if the current object is in asynchronous mode and interacting
with DB server.
isFetched
public boolean isFetched()
- This method tells you whether the current row has been fetched into the
cached object.
isOpen
public boolean isOpen()
- This method tells you whether a cursor is open and usable.
isAfterLastRow
public boolean isAfterLastRow()
- This method tells you whether last row was already fetched.
items
public Vector items()
- Returns:
- - a vector containing references to all the row
objects in the current cached sequence, thus providing
you with access to the sequence.
open
public abstract void open(String whereSfx) throws DAException
- This abstract method can be implemented in a extending class, as it is
in the classes generated by the Data Access Builder, to
open a cursor for the rows specified in the passed-in SQL suffix.
- Parameters:
- whereSfx - - where clause
- Throws: DAException
- - when data access error occurs.
removeManagerCompleteListener
public void removeManagerCompleteListener(ManagerCompleteListener l)
- Use this method to remove the method complete listener on the manager
object.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
- Use this method to remove the property change listener on the manager
object.
select
public abstract void select(String whereSfx) throws DAException
- This abstract method can be implemented in an extending class so that
it opens a cursor, retrieves rows as specified in the
passed-in SQL predicate into a collection, and closes the cursor.
- Parameters:
- whereSfx - - where clause
- Throws: DAException
- - when data access error occurs.
setAsynchronous
public void setAsynchronous(boolean isAs)
- This method lets you set whether the database methods are run on a
background thread.
setObjectsDatastore
public void setObjectsDatastore(DatastoreJDBC oDs)
- This method sets the datastore associated with the current manager object
to the DatastoreJDBC object passed in.
setQueryTimeout
public void setQueryTimeout(int ti)
- Use this method to set the maximum time (in seconds) that the database
driver will wait for a query to be run.
setMaxRows
public void setMaxRows(int rc)
- Use this method to set the maximum number of rows that a result set can
contain.
updateFetched
public void updateFetched() throws DAException
- This method, when implemented in a subclass (such as <class>
Manager, which is generated by Data Access Builder), updates the
row corresponding to the fetched object, if there is one,
with the cached object's attributes.
- Throws: DAException
- - when data access error occurs.
All Packages Class Hierarchy This Package Previous Next Index