|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CSqlConnection: public CInterface { public: CSqlConnection(); virtual ~CSqlConnection(); public: enum { autoCommit, manualCommit }; public: virtual void Connect( const CString &strSource, const CString &strUser, const CString &strAuthentication) = 0; virtual void SetCommitMode(int nMode) = 0; virtual void Commit() = 0; virtual void Rollback() = 0; virtual XSqlStatement CreateStatement() = 0; };
The abstract interace to connection objects.
The connection object represents connection to a single data source.
Connection objects provide interface for controlling transactions and serve as factories for SQL statements.
CSqlStatement
Constructor/Destructor Summary | |
CSqlConnection
();
����������Constructs the connection object. |
|
~CSqlConnection
();
����������Destroys the connection object. |
Function Summary | |
void
|
Connect
(const CString &strSource, const CString &strUser, const CString &strAuthentication);
����������Connects to a specified data source. |
void
|
SetCommitMode
(int nMode);
����������Specifies the new commit mode for this connection. |
void
|
Commit
();
����������Commits all transactions on this connection. |
void
|
Rollback
();
����������Rollbacks all transactions on this connection. |
XSqlStatement
|
CreateStatement
();
����������Creates a new statement. |
Constructor/Destructor Detail |
CSqlConnection();
Constructs the connection object.
virtual ~CSqlConnection();
Destroys the connection object.
Function Detail |
virtual void Connect( const CString &strSource, const CString &strUser, const CString &strAuthentication) = 0;
Connects to a specified data source.
The connection to the data source must be established prior to any data access operation.
The name of the data source must be specified as
the parameter of
Connect
. The format
of the data source name is platform-dependent.
Some data sources may require specification of the user name and the authentication information as additional parameters. The format of the user name and the authentication information is platform-dependent.
strSource
- the data source namestrUser
- the optional user name; the empty string
if not specifiedstrAuthentication
- the optional authentication
string; empty if not specifiedvirtual void SetCommitMode(int nMode) = 0;
Specifies the new commit mode for this connection.
The allowed values for the commit mode are
autoCommit
and
manualCommit
.
The commit mode indicates the application programmers'
suggestions about how transactions should be commited.
The value
autoCommit
specifies the auto-commit
mode. When this mode is set, each statement is commited
immediately after it is executed. This is the default mode.
The value
manualCommit
specifies
the manual-commit mode. When this mode is set, a new transaction
is implicitly started when the SQL statement which can be contained
within a transaction is executed on this connection.
The transaction must be eventually commited by the explicit call
to
Commit
or rolled back by the explicit call to
Rollback
.
Data sources are not required to support both commit modes, and the exact implementation of modes supported by each particular data source is platform-dependent.
nMode
- the commit modevirtual void Commit() = 0;
Commits all transactions on this connection.
The behavior is platform-dependent.
virtual void Rollback() = 0;
Rollbacks all transactions on this connection.
The behavior is platform-dependent.
virtual XSqlStatement CreateStatement() = 0;
Creates a new statement.
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |