|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.storage.database.DatabaseTransaction
Database transaction object. Used to maintain context (connection) between separate database statements, allowing for rollback in complex database transactions (if supported). This class is a base class for making connections and submitting changes to the database.
| Constructor Summary | |
DatabaseTransaction(DatabaseStorage database,
boolean useRollback)
Deprecated. Instantiate a database transaction. |
|
| Method Summary | |
boolean |
commit()
Deprecated. Closes and commits the transaction. |
boolean |
databaseSupportsRollback()
Deprecated. Queries the database metadata to test whether this database supports rollback. |
java.sql.ResultSet |
executeQuery(java.lang.String sql)
Deprecated. Execute a SQL statement on the database, and return the Resultset. |
boolean |
executeUpdate(java.lang.String sql)
Deprecated. Execute a SQL statement on the database. |
boolean |
executeUpdate(java.lang.String sql,
java.util.List fields,
MMObjectNode node)
Deprecated. Execute a SQL statement on the database. |
int |
getIntegerResult()
Deprecated. Attempts to return a single integer result from the last retrieved resultset. |
MMObjectNode |
getNodeResult(MMObjectBuilder builder)
Deprecated. Attempts to return a single Node from the last retrieved resultset. |
java.util.Set |
getTables(java.lang.String baseName)
Deprecated. Queries the database metadata to obtain a list of tables following a specified pattern. |
boolean |
hasTable(java.lang.String tableName)
Deprecated. Queries the database metadata to test whether a given table exists. |
void |
registerChanged(MMObjectNode node,
java.lang.String change)
Deprecated. Register changes for broadcasting after commit |
boolean |
rollback()
Deprecated. Rolls back (cancels) the transaction. |
boolean |
supportsRollback()
Deprecated. Returns true if this transaction supports rollback. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DatabaseTransaction(DatabaseStorage database,
boolean useRollback)
throws StorageException
database - the database for which to make the transactionuseRollback - if true, the transaction should use rollback facilities if the database supports them
StorageException - when a connection could not be made| Method Detail |
public boolean databaseSupportsRollback()
throws StorageException
StorageException - when the metadata could not be retrievedpublic boolean supportsRollback()
supportsRollback in interface Transaction
public boolean hasTable(java.lang.String tableName)
throws StorageException
tableName - nam of the table to look for
StorageException - when the metadata could not be retrieved
public java.util.Set getTables(java.lang.String baseName)
throws StorageException
baseName - the prefix (base name) of the names of the tables to look for
StorageException - when the metadata could not be retrievedpublic boolean commit()
commit in interface Transaction
public void registerChanged(MMObjectNode node,
java.lang.String change)
node - the node to registerchange - the type of change: "n": new, "c": commit, "d": deletepublic boolean rollback()
rollback in interface Transaction
public java.sql.ResultSet executeQuery(java.lang.String sql)
throws StorageException
sql - the sql query to execute
StorageException - when the query failed
public boolean executeUpdate(java.lang.String sql)
throws StorageException
sql - the sql query to execute.
StorageException - when the statement failed
public boolean executeUpdate(java.lang.String sql,
java.util.List fields,
MMObjectNode node)
throws StorageException
sql - the sql query to execute.fields - the list of FieldDefs whose values should be added as the query parameters.node - the node that contains the field data
StorageException - when the statement failedpublic int getIntegerResult()
public MMObjectNode getNodeResult(MMObjectBuilder builder)
builder - the builder to use for creating the node
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||