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 $
-
beginTransaction()
- Begin an explicit transaction.
-
commitTransaction()
- Commit all changes made since the last beginTransaction (there may be none)
Resume automatically commiting individual row changes.
-
connect()
- Connect to the data source using current connection settings
-
connect(String, Properties)
- connect to the specified database URL passing any required connection arguments in a Properties Object.
-
connect(String, String, String)
- Connect to the specified database URL using the specified user ID and password
-
disconnect()
- Disconnect from the database
-
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)
-
executeRetrieval(String, String, String)
- This method executes the specified retrieval query and returns
the result as a DataItem.
-
flush()
- Explicitly propagate all changes to the database without commiting them.
-
getPropertyInfo(String, Properties)
- Discover what connection arguments are required.
-
rollbackTransaction()
- Undo all changes made since the last beginTransaction (there may be none)
Resume automatically commiting individual row changes.
-
validate()
- Explicitly validate all changes to the database without committing them.
connect
public abstract void connect() throws SQLException
- Connect to the data source using current connection settings
- Throws: SQLException
- if the query failed
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
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
disconnect
public abstract void disconnect() throws SQLException
- Disconnect from the database
- Throws: SQLException
- if the query failed
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)
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
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
beginTransaction
public abstract void beginTransaction()
- Begin an explicit transaction. Individual row changes will no longer be
automatically commited.
- Throws: UnsupportedOperationException
- if not supported.
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.
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.
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.
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