Interface powersoft.jcm.db.Transaction
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface powersoft.jcm.db.Transaction

public interface Transaction
extends Object
Encapsulates the connection to a database. Each specific transaction class (eg., JDBCTransaction) provides an implementation of this interface.
See Also:
JDBCTransaction, Query

Method Index

 o addQuery(Query)
Associates a query object with a transaction object.
 o commit()
Requests a commit for all active data source operations on all query objects associated with the transaction object.
 o connect()
Connects the transaction object to a data source.
 o disconnect()
Closes the connection, if one exists, between a data source and the transaction object.
 o getAutoCommit()
Determines whether the transaction object is in auto-commit or manual-commit mode.
 o getConnected()
Determines whether the transaction object is connected to a data source.
 o getDataSource()
Gets the name of the data source (database) the transaction object is connected to.
 o getPassword()
Gets the password used in the connection.
 o getTraceToLog()
Retrieves the current setting of the TraceToLog property.
 o getUserid()
Gets the user ID used in the connection.
 o removeQuery(Query)
Disassociates a query object from a transaction object.
 o rollback()
Requests a rollback of all active data source operations on all query objects associated with the transaction object since the last time the Commit method was invoked.
 o setAutoCommit(boolean)
Determines whether the transaction object is in auto-commit or manual-commit mode.
 o setDataSource(String)
Sets the name of the data source (database) the transaction object is connected to.
 o setPassword(String)
Sets the password used in the connection.
 o setTraceToLog(boolean)
Sets the TraceToLog property.

The TraceToLog property determines whether the object records important actions in the debug log.

Notes: Information is only written to the debug log when you run a Debug version of the application.

 o setUserid(String)
Sets the user ID used in the connection.

Methods

 o addQuery
  public abstract void addQuery(Query query)
Associates a query object with a transaction object.
Parameters:
query - The query to be associated with the transaction object.
 o commit
  public abstract boolean commit()
Requests a commit for all active data source operations on all query objects associated with the transaction object. The transaction object must be in manual-commit mode for this method to have any effect.
Returns:
true if the commit operation was successful; false if the commit operation failed.
 o connect
  public abstract boolean connect()
Connects the transaction object to a data source.
Returns:
true if the connection was succesfully established; false otherwise
 o disconnect
  public abstract boolean disconnect()
Closes the connection, if one exists, between a data source and the transaction object.
Returns:
true if it was successfully closed or if there was no connection. false if the connection could not be closed.
 o removeQuery
  public abstract void removeQuery(Query query)
Disassociates a query object from a transaction object.
Parameters:
query - The query to be disassociated.
 o rollback
  public abstract boolean rollback()
Requests a rollback of all active data source operations on all query objects associated with the transaction object since the last time the Commit method was invoked. The transaction object must be in manual-commit mode for this method to have any effect.
Returns:
true if the rollback operation was successful; false otherwise.
 o getAutoCommit
  public abstract boolean getAutoCommit()
Determines whether the transaction object is in auto-commit or manual-commit mode.
Returns:
true if the transaction object is in auto-commit mode; false if the transaction object is in manual-commit mode.
 o setAutoCommit
  public abstract void setAutoCommit(boolean autoCommit)
Determines whether the transaction object is in auto-commit or manual-commit mode.
Parameters:
autoCommit - If true, the transaction object is placed in auto-commit mode. If false, the transaction object is placed in manual-commit mode.
 o getConnected
  public abstract boolean getConnected()
Determines whether the transaction object is connected to a data source.
Returns:
true if the transaction object is connected; false otherwise.
 o getDataSource
  public abstract String getDataSource()
Gets the name of the data source (database) the transaction object is connected to.
Returns:
dataSource The name of the data source.
 o setDataSource
  public abstract void setDataSource(String dataSrc)
Sets the name of the data source (database) the transaction object is connected to.
Parameters:
dataSource - The name of the data source.
 o getPassword
  public abstract String getPassword()
Gets the password used in the connection.
Returns:
The password used in the connection.
 o setPassword
  public abstract void setPassword(String password)
Sets the password used in the connection.
Parameters:
password - The password used in the connection.
 o getUserid
  public abstract String getUserid()
Gets the user ID used in the connection.
Returns:
The user ID used in the connection.
 o setUserid
  public abstract void setUserid(String userid)
Sets the user ID used in the connection.
Parameters:
userid - The user ID to be used in the connection.
 o getTraceToLog
  public abstract boolean getTraceToLog()
Retrieves the current setting of the TraceToLog property.
Returns:
true if the property is set; false otherwise.
 o setTraceToLog
  public abstract void setTraceToLog(boolean traceToLog)
Sets the TraceToLog property.

The TraceToLog property determines whether the object records important actions in the debug log.

Notes: Information is only written to the debug log when you run a Debug version of the application. With Release versions, the TraceToLog property has no effect.

Parameters:
traceToLog - If true and a debug version of the application is running, information will be written to the debug log. If false or a release version of the application is running, no information will be written to the debug log.

All Packages  Class Hierarchy  This Package  Previous  Next  Index