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
-
addQuery(Query)
- Associates a query object with a transaction object.
-
commit()
- Requests a commit for all active data source operations on all
query objects associated with the transaction object.
-
connect()
- Connects the transaction object to a data source.
-
disconnect()
- Closes the connection, if one exists, between a data source and
the transaction object.
-
getAutoCommit()
- Determines whether the transaction object is in auto-commit or
manual-commit mode.
-
getConnected()
- Determines whether the transaction object is connected to a
data source.
-
getDataSource()
- Gets the name of the data source (database) the transaction
object is connected to.
-
getPassword()
- Gets the password used in the connection.
-
getTraceToLog()
- Retrieves the current setting of the TraceToLog property.
-
getUserid()
- Gets the user ID used in the connection.
-
removeQuery(Query)
- Disassociates a query object from a transaction object.
-
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.
-
setAutoCommit(boolean)
- Determines whether the transaction object is in auto-commit or
manual-commit mode.
-
setDataSource(String)
- Sets the name of the data source (database) the transaction
object is connected to.
-
setPassword(String)
- Sets the password used in the connection.
-
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.
-
setUserid(String)
- Sets the user ID used in the connection.
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.
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.
connect
public abstract boolean connect()
- Connects the transaction object to a data source.
- Returns:
-
true
if the connection was succesfully established;
false
otherwise
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.
removeQuery
public abstract void removeQuery(Query query)
- Disassociates a query object from a transaction object.
- Parameters:
- query - The query to be disassociated.
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.
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.
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.
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.
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.
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.
getPassword
public abstract String getPassword()
- Gets the password used in the connection.
- Returns:
- The password used in the connection.
setPassword
public abstract void setPassword(String password)
- Sets the password used in the connection.
- Parameters:
- password - The password used in the connection.
getUserid
public abstract String getUserid()
- Gets the user ID used in the connection.
- Returns:
- The user ID used in the connection.
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.
getTraceToLog
public abstract boolean getTraceToLog()
- Retrieves the current setting of the TraceToLog property.
- Returns:
-
true
if the property is set;
false
otherwise.
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