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 >

Method Index

 o _executeAction(String, Object[])
 o _handleException(Exception)
 o addManagerCompleteListener(ManagerCompleteListener)
Use this method to register a listener for method complete events.
 o addPropertyChangeListener(PropertyChangeListener)
Use this method to register a listener for property changes.
 o 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.
 o append(Vector, int)
Use this method to append the specified number of rows from the datastore to the passed-in Vector object.
 o cancel()
This method cancels the SQL statement that is currently running.
 o close()
This method closes the cursor if one is open.
 o 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.
 o elementAsDataAccessObject()
 o fetchNext()
This method fetches the attributes from the next row into the cached object (a default object is provided).
 o fetchNextInto(DataAccessObject)
This method fetches the attributes from the next row into a PersistentObject object.
 o fill(int)
This method fetches the specified number of rows into the cached vector, starting at the row after the last-fetched row.
 o 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.
 o getCurrentDatastore()
This method is to be implemented in a subclass.
 o getMaxRows()
 o getObjectsDatastore()
 o getQueryTimeout()
 o isAfterLastRow()
This method tells you whether last row was already fetched.
 o isAsynchronous()
 o isBusy()
 o isFetched()
This method tells you whether the current row has been fetched into the cached object.
 o isOpen()
This method tells you whether a cursor is open and usable.
 o items()
 o 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.
 o prepareOpen(String, Object[], int[])
Use this method when You want prepare and execute parametrized statement.
 o removeManagerCompleteListener(ManagerCompleteListener)
Use this method to remove the method complete listener on the manager object.
 o removePropertyChangeListener(PropertyChangeListener)
Use this method to remove the property change listener on the manager object.
 o 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.
 o setAsynchronous(boolean)
This method lets you set whether the database methods are run on a background thread.
 o setMaxRows(int)
Use this method to set the maximum number of rows that a result set can contain.
 o setObjectsDatastore(DatastoreJDBC)
This method sets the datastore associated with the current manager object to the DatastoreJDBC object passed in.
 o setQueryTimeout(int)
Use this method to set the maximum time (in seconds) that the database driver will wait for a query to be run.
 o 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.

Methods

 o _executeAction
 public void _executeAction(String acnN,
                            Object params[]) throws Exception
 o _handleException
 public void _handleException(Exception ex)
 o addManagerCompleteListener
 public void addManagerCompleteListener(ManagerCompleteListener l)
Use this method to register a listener for method complete events.

 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener l)
Use this method to register a listener for property changes.

 o 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.
 o 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.
 o cancel
 public void cancel() throws DAException
This method cancels the SQL statement that is currently running.

Throws: DAException
- when data access error occurs.
 o close
 public void close() throws DAException
This method closes the cursor if one is open.

Throws: DAException
- when data access error occurs.
 o 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.
 o 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
 o elementAsDataAccessObject
 public DataAccessObject elementAsDataAccessObject()
Returns:
- the current cached object (that is, the currently-fetched row).
 o 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.
 o 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.
 o 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.
 o 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.
 o getCurrentDatastore
 public abstract DatastoreJDBC getCurrentDatastore()
This method is to be implemented in a subclass.

Returns:
- the object's current datastore.
 o getObjectsDatastore
 public DatastoreJDBC getObjectsDatastore()
Returns:
- the datastore object associated with the current object.
 o 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.
 o 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.
 o isAsynchronous
 public boolean isAsynchronous()
Returns:
true if the current object is in asynchronous mode.
 o isBusy
 public boolean isBusy()
Returns:
true if the current object is in asynchronous mode and interacting with DB server.
 o isFetched
 public boolean isFetched()
This method tells you whether the current row has been fetched into the cached object.

 o isOpen
 public boolean isOpen()
This method tells you whether a cursor is open and usable.

 o isAfterLastRow
 public boolean isAfterLastRow()
This method tells you whether last row was already fetched.

 o 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.
 o 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.
 o removeManagerCompleteListener
 public void removeManagerCompleteListener(ManagerCompleteListener l)
Use this method to remove the method complete listener on the manager object.

 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener l)
Use this method to remove the property change listener on the manager object.

 o 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.
 o setAsynchronous
 public void setAsynchronous(boolean isAs)
This method lets you set whether the database methods are run on a background thread.

 o setObjectsDatastore
 public void setObjectsDatastore(DatastoreJDBC oDs)
This method sets the datastore associated with the current manager object to the DatastoreJDBC object passed in.

 o 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.

 o setMaxRows
 public void setMaxRows(int rc)
Use this method to set the maximum number of rows that a result set can contain.

 o 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