Proud::COdbcConnection Class Reference

Public Member Functions

PROUDSRV_API void Open (const String &dsn, const String &id, const String &passwd, COdbcWarnings *odbcWarnings=NULL)
 
PROUDSRV_API void Open (const String &connectionString, COdbcWarnings *odbcWarnings=NULL)
 
PROUDSRV_API void Close ()
 
PROUDSRV_API void BeginTrans ()
 
PROUDSRV_API void RollbackTrans ()
 
PROUDSRV_API void CommitTrans ()
 
PROUDSRV_API bool IsOpened ()
 
PROUDSRV_API int Execute (const String &query, COdbcWarnings *odbcWarnings=NULL)
 
PROUDSRV_API int Execute (COdbcRecordset &recordset, const String &query, COdbcWarnings *odbcWarnings=NULL)
 
void AllocStmtHandle (COdbcHandle *hstmt, OdbcPrepareType typem, COdbcWarnings *odbcWarnings=NULL)
 

Detailed Description

It is a class that can manage Connection, control Transaction and execute DirectExecute. Register a driver of database that you are using by the ODBC manager and access through DSN(Data Source Name).

Member Function Documentation

PROUDSRV_API void Proud::COdbcConnection::BeginTrans ( )

It is used when starting transaction. In case transaction ends by executing RollbackTrans() or CommitTrans(), it is applied only when re-calling.

PROUDSRV_API void Proud::COdbcConnection::Close ( )

It is used when disconnection. It has an effect on all COdbcCommand objects and COdbcRecordset objects that have been created by this connection.

PROUDSRV_API void Proud::COdbcConnection::CommitTrans ( )

It is used when committing transaction.

PROUDSRV_API int Proud::COdbcConnection::Execute ( const String query,
COdbcWarnings odbcWarnings = NULL 
)

It executed a direct query.

Parameters
queryIt is a query.
PROUDSRV_API int Proud::COdbcConnection::Execute ( COdbcRecordset recordset,
const String query,
COdbcWarnings odbcWarnings = NULL 
)

It executed a direct query.

Parameters
recordsetIt is a Recordset object that is received when executing SELECT query.
queryIt is a query.
PROUDSRV_API bool Proud::COdbcConnection::IsOpened ( )

It is used when checking if connection to the database is normal.

PROUDSRV_API void Proud::COdbcConnection::Open ( const String dsn,
const String id,
const String passwd,
COdbcWarnings odbcWarnings = NULL 
)

It is used when connecting to the database.

PROUDSRV_API void Proud::COdbcConnection::Open ( const String connectionString,
COdbcWarnings odbcWarnings = NULL 
)

It is used when connecting to the database. ex> conn.Open("DSN=MsSqlDsn;UID=root;PWD=1234")

PROUDSRV_API void Proud::COdbcConnection::RollbackTrans ( )

It is used when transaction rollback.