com.sibvisions.rad.persist.jdbc
Interface IDBAccess

All Known Implementing Classes:
DB2DBAccess, DBAccess, DerbyDBAccess, HSQLDBAccess, MSSQLDBAccess, MySQLDBAccess, OracleDBAccess, PostgreSQLDBAccess

public interface IDBAccess

The IDBAccess defines the methods to access any kind of table oriented storage: e.g. a database, XML file, ...

It extends the IDataSource interface with the table oriented storage modification methods.

See Also:
IDataPage, IDataBook

Method Summary
 void delete(String pWritebackTable, ServerMetaData pServerMetaData, Object[] pDeleteDataRow)
          Deletes the specified row.
 List<Object[]> fetch(ServerMetaData pServerMetaData, String pBeforeQueryColumns, String[] pQueryColumns, String pFromClause, ICondition pFilter, String pWhereClause, String pAfterWhereClause, SortDefinition pSort, int pFromRow, int pMinimumRowCount)
          Returns the List of fetched rows (as List of Object[]) for the specified query tables and parameters.
 Object[] insert(String pWritebackTable, ServerMetaData pServerMetaData, Object[] pNewDataRow)
          Returns the newly inserted row from the write back table.
 void lockRow(String pWritebackTable, ServerMetaData pServerMetaData, ICondition pPKFilter)
          It locks the specified row in the storage.
 Object[] update(String pWritebackTable, ServerMetaData pServerMetaData, Object[] pOldDataRow, Object[] pNewDataRow)
          Return the updated row.
 

Method Detail

fetch

List<Object[]> fetch(ServerMetaData pServerMetaData,
                     String pBeforeQueryColumns,
                     String[] pQueryColumns,
                     String pFromClause,
                     ICondition pFilter,
                     String pWhereClause,
                     String pAfterWhereClause,
                     SortDefinition pSort,
                     int pFromRow,
                     int pMinimumRowCount)
                     throws DataSourceException
Returns the List of fetched rows (as List of Object[]) for the specified query tables and parameters. It fetch's the the rows from pFromRow row index a minimum amount of pMinimumRowCount rows. Implementations should fetch as much rows as possible in a proper amount of time, to get less requests from the client model to the server IDBAccess. Implementation can cache the select cursor and reuse it for the next fetch operation, but they should take care, that's a state less call and in a fall over case it maybe loose on the fail over system the cursor.

Parameters:
pBeforeQueryColumns - the before query columns
pQueryColumns - the query columns
pFromClause - the from clause with query tables and join definitions
pFilter - the filter to use
pWhereClause - the last where condition in query
pAfterWhereClause - the after where clause in query
pSort - the sort order to use
pFromRow - the row index from to fetch
pMinimumRowCount - the minimum count row to fetch
pServerMetaData - the MetaDataColumn array to use.
Returns:
the List of fetched rows (as List of Object[]) for the specified query tables and parameters.
Throws:
DataSourceException - if the fetch fails.

lockRow

void lockRow(String pWritebackTable,
             ServerMetaData pServerMetaData,
             ICondition pPKFilter)
             throws DataSourceException
It locks the specified row in the storage.

Parameters:
pWritebackTable - the storage unit to use
pPKFilter - the PrimaryKey in as an ICondition to identify the row to lock
pServerMetaData - the MetaDataColumn array to use.
Throws:
DataSourceException - if an Exception occur during interacting with the storage

insert

Object[] insert(String pWritebackTable,
                ServerMetaData pServerMetaData,
                Object[] pNewDataRow)
                throws DataSourceException
Returns the newly inserted row from the write back table.

Parameters:
pWritebackTable - the write back table to use.
pServerMetaData - the meta data to use.
pNewDataRow - the new values Object[] to insert.
Returns:
the newly inserted row as Object[] from the write back table.
Throws:
DataSourceException - if an Exception occur during insert the row to the table

update

Object[] update(String pWritebackTable,
                ServerMetaData pServerMetaData,
                Object[] pOldDataRow,
                Object[] pNewDataRow)
                throws DataSourceException
Return the updated row.

Parameters:
pWritebackTable - the write back table to use.
pServerMetaData - the meta data to use.
pOldDataRow - the old values of the row
pNewDataRow - the new values of the row
Returns:
the updated row.
Throws:
DataSourceException - if an Exception occur during update.

delete

void delete(String pWritebackTable,
            ServerMetaData pServerMetaData,
            Object[] pDeleteDataRow)
            throws DataSourceException
Deletes the specified row.

Parameters:
pWritebackTable - the write back table to use.
pServerMetaData - the meta data to use.
pDeleteDataRow - the row to delete.
Throws:
DataSourceException - if an Exception occur during delete.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.