All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface org.xmlmiddleware.xmldbms.datahandlers.DataHandler

public interface DataHandler
Interface for abstracting database access.

Objects that implement DataHandler should provide a no-argument constructor.


Variable Index

 o COMMIT_AFTERDOCUMENT
Commit transaction after the whole document
 o COMMIT_AFTERSTATEMENT
Commit transaction after each statement.
 o COMMIT_NONE
Let calling code commit transaction.
 o COMMIT_NOTRANSACTIONS
Disable transactions all together.

Method Index

 o delete(Table, Key, Object[], String, Column[], Object[])
Delete rows from a given table.
 o delete(Table, Row, Key)
 o endDocument()
 o initialize(DataSource, String, String)
Initialize a DataHandler object
 o insert(Table, Row)
 o select(Table, Key, Object[], String, Column[], Object[], OrderInfo)
Select rows from a given table.
 o startDocument(int)
 o update(Table, Row, Column[])
 o updateOrInsert(Table, Row)

Variables

 o COMMIT_AFTERSTATEMENT
 public static final int COMMIT_AFTERSTATEMENT
Commit transaction after each statement.

 o COMMIT_AFTERDOCUMENT
 public static final int COMMIT_AFTERDOCUMENT
Commit transaction after the whole document

 o COMMIT_NONE
 public static final int COMMIT_NONE
Let calling code commit transaction. Useful when part of a larger transaction.

 o COMMIT_NOTRANSACTIONS
 public static final int COMMIT_NOTRANSACTIONS
Disable transactions all together.

Methods

 o initialize
 public abstract void initialize(DataSource dataSource,
                                 String user,
                                 String password) throws SQLException
Initialize a DataHandler object

Parameters:
dataSource - The DataSource to get Connection's from.
user - User to connect to the database as.
password - Password to connect to the database with.
 o startDocument
 public abstract void startDocument(int commitMode) throws SQLException
 o endDocument
 public abstract void endDocument() throws SQLException
 o insert
 public abstract void insert(Table table,
                             Row row) throws SQLException
 o update
 public abstract void update(Table table,
                             Row row,
                             Column columns[]) throws SQLException
 o updateOrInsert
 public abstract void updateOrInsert(Table table,
                                     Row row) throws SQLException
 o delete
 public abstract void delete(Table table,
                             Row row,
                             Key key) throws SQLException
 o delete
 public abstract void delete(Table table,
                             Key key,
                             Object keyValue[],
                             String where,
                             Column paramColumns[],
                             Object paramValues[]) throws SQLException
Delete rows from a given table.

The DELETE statement has the form:

    SELECT FROM Table WHERE Key = ? AND <where>
 

Parameters:
t - The table to select from. Must not be null.
key - The key to restrict with. May be null.
keyValue - The value of the key.
where - An additional where constraint. May be null.
paramColumns - The columns corresponding to parameters in the where constraint. Null if there are no parameters.
paramValues - The values of parameters in the where constraint. Null if there are no parameters.
 o select
 public abstract ResultSet select(Table table,
                                  Key key,
                                  Object keyValue[],
                                  String where,
                                  Column paramColumns[],
                                  Object paramValues[],
                                  OrderInfo orderInfo) throws SQLException
Select rows from a given table.

The SELECT statement has the form:

    SELECT * FROM Table WHERE Key = ? AND <where> ORDER BY ?
 

Parameters:
t - The table to select from. Must not be null.
key - The key to restrict with. May be null.
keyValue - The value of the key.
where - An additional where constraint. May be null.
paramColumns - The columns corresponding to parameters in the where constraint. Null if there are no parameters.
paramValues - The values of parameters in the where constraint. Null if there are no parameters.
order - The sort information. May be null.
Returns:
The result set.

All Packages  Class Hierarchy  This Package  Previous  Next  Index