All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface javax.infobus.DbAccess

public interface DbAccess
DataItems that implement the DbAccess interface represent a database. The DbAccess interface contains methods to determine what arguments are needed to connect to the database, to connect to and disconnect from the database, to execute retrieval and non-retrieval queries, to control transactions, and to validate changes made to the database.

Version:
$Revision: 1.14 $

Method Index

 o beginTransaction()
Begin an explicit transaction.
 o commitTransaction()
Commit all changes made since the last beginTransaction (there may be none) Resume automatically commiting individual row changes.
 o connect()
Connect to the data source using current connection settings
 o connect(String, Properties)
connect to the specified database URL passing any required connection arguments in a Properties Object.
 o connect(String, String, String)
Connect to the specified database URL using the specified user ID and password
 o disconnect()
Disconnect from the database
 o executeCommand(String, String)
executes the specified non-retrieval query and returns the count of rows affected, or -1 if this is not applicable (the query does not manipulate rows)
 o executeRetrieval(String, String, String)
This method executes the specified retrieval query and returns the result as a DataItem.
 o flush()
Explicitly propagate all changes to the database without commiting them.
 o getPropertyInfo(String, Properties)
Discover what connection arguments are required.
 o rollbackTransaction()
Undo all changes made since the last beginTransaction (there may be none) Resume automatically commiting individual row changes.
 o validate()
Explicitly validate all changes to the database without committing them.

Methods

 o connect
 public abstract void connect() throws SQLException
Connect to the data source using current connection settings

Throws: SQLException
if the query failed
 o connect
 public abstract void connect(String url,
                              String username,
                              String password) throws SQLException
Connect to the specified database URL using the specified user ID and password

Parameters:
url - the database URL
username - the user ID
passwword - the password
Throws: SQLException
if the query failed
 o connect
 public abstract void connect(String url,
                              Properties info) throws SQLException
connect to the specified database URL passing any required connection arguments in a Properties Object.

Parameters:
url - the database URL
info - the Properties object containing any required information such as username or password.
Throws: SQLException
if the query failed
 o disconnect
 public abstract void disconnect() throws SQLException
Disconnect from the database

Throws: SQLException
if the query failed
 o getPropertyInfo
 public abstract DriverPropertyInfo[] getPropertyInfo(String url,
                                                      Properties info)
Discover what connection arguments are required.

Parameters:
url - database URL
info - proposed connection arguments (may be initially empty)
 o executeRetrieval
 public abstract Object executeRetrieval(String retrieval,
                                         String dataItemName,
                                         String options) throws SQLException
This method executes the specified retrieval query and returns the result as a DataItem.

Parameters:
retrieval - the retrieval query; typically a SQL SELECT or a stored procedure which returns a result
dataItemName - if not null, instructs the data provider to make the resulting RowsetAccess item available under the specified name
options - space delimited list of option strings
Returns:
the query results as a DataItem implementing RowsetAccess
Throws: SQLException
if the query failed
 o executeCommand
 public abstract int executeCommand(String command,
                                    String dataItemName) throws SQLException
executes the specified non-retrieval query and returns the count of rows affected, or -1 if this is not applicable (the query does not manipulate rows)

Parameters:
command - the non-retrieval command to execute
dataItemName - if not null, instructs the data provider to make the count of affected rows available as an ImmediateAccess DataItem with the specifed name
Throws: SQLException
if the query failed
 o beginTransaction
 public abstract void beginTransaction()
Begin an explicit transaction. Individual row changes will no longer be automatically commited.

Throws: UnsupportedOperationException
if not supported.
 o commitTransaction
 public abstract void commitTransaction() throws SQLException, RowsetValidationException
Commit all changes made since the last beginTransaction (there may be none) Resume automatically commiting individual row changes.

Throws: UnsupportedOperationException
if not supported.
Throws: SQLException
if a backend database error occurred
Throws: RowsetValidationException
if the data producer detected an invalid change.
 o rollbackTransaction
 public abstract void rollbackTransaction() throws SQLException, RowsetValidationException
Undo all changes made since the last beginTransaction (there may be none) Resume automatically commiting individual row changes.

Throws: UnsupportedOperationException
if not supported.
Throws: SQLException
if a backend database error occurred
Throws: RowsetValidationException
if the data producer detected an invalid change.
 o validate
 public abstract void validate() throws SQLException, RowsetValidationException
Explicitly validate all changes to the database without committing them. This may be done by the data producer without interacting with the database. Does nothing and does not throw an exception if not supported.

Throws: SQLException
if a backend database error occurred
Throws: RowsetValidationException
if the data producer detected an invalid change.
 o flush
 public abstract void flush() throws SQLException, RowsetValidationException
Explicitly propagate all changes to the database without commiting them. This may encounter exceptions.

Throws: SQLException
if a backend database error occurred
Throws: RowsetValidationException
if the data producer detected an invalid change.

All Packages  Class Hierarchy  This Package  Previous  Next  Index