Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

odbc_dbserver Class Reference

implementation dbserver interface for ODBC driver More...

#include <odbcsrv.h>

Inheritance diagram for odbc_dbserver:

dbserver_impl dbserver terimber_thread_employer terimber_log_helper terimber_log

List of all members.

Public Member Functions

 odbc_dbserver (size_t ident)
 constructor
virtual ~odbc_dbserver ()
 destructor

Protected Member Functions

virtual void v_connect (bool trusted_connection, const char *connection_string)
 establishes connection to db
virtual void v_disconnect ()
 closes connection
virtual void v_start_transaction ()
 starts transaction
virtual void v_commit ()
 commits transaction
virtual void v_rollback ()
 rolls back transaction
virtual bool v_is_connect_alive ()
 checks if the connection is alive
virtual void v_before_execute ()
 pure virtual functions
virtual void v_after_execute ()
 calls additional function after executing the sql statement
virtual void v_execute ()
 executes SQL expression
virtual void v_close ()
 closes opened query
virtual void v_fetch ()
 fetches block of rows
virtual void v_replace_quote ()
 replaces quote to the available sign for native drive
virtual void v_bind_one_param (size_t index)
 binds one param by index
virtual void v_before_bind_columns ()
 before bind columns sometimes we got db specific
virtual void v_bind_one_column (size_t index)
 binds one column by index
virtual size_t v_get_number_columns ()
 gets number columns in query
virtual void v_convert_one_value (size_t row, size_t col, terimber_db_value &val)
 converts one field value to variant buffer
virtual void v_get_one_column_info (size_t index)
 gets one column info from native driver
virtual void v_form_sql_string ()
 forms SQL expression depending on type selected and native driver
virtual void v_rebind_one_param (size_t index)
 rebinds one param for input/output or output params
virtual void v_interrupt_async ()
 terminates asynchronous action
virtual dbtypes v_native_type_to_client_type (size_t native_type)
 converts types

Static Private Member Functions

static void get_odbc_error (size_t code, SQLHENV henv, SQLHDBC hdbc, SQLHSTMT hstmt)
 retrives the error descripton from the ODBC driver

Private Attributes

SQLHENV _henv
 ODBC environment handle.
SQLHDBC _hdbc
 ODBC DB connection handle.
SQLHSTMT _hstmt
 ODBC statment handle.
bool _bind_cols


Detailed Description

implementation dbserver interface for ODBC driver

Definition at line 39 of file odbcsrv.h.


Constructor & Destructor Documentation

odbc_dbserver::odbc_dbserver ( size_t  ident  ) 

constructor

Parameters:
ident  server ident

Definition at line 87 of file odbcsrv.cpp.

odbc_dbserver::~odbc_dbserver (  )  [virtual]


Member Function Documentation

void odbc_dbserver::v_connect ( bool  trusted_connection,
const char *  connection_string 
) [protected, virtual]

establishes connection to db

must be overriden database specific

Implements dbserver_impl.

Definition at line 107 of file odbcsrv.cpp.

References _hdbc, _henv, dbserver_impl::_temp_allocator, check_retcode_db, MAX_CONNECT_LEN, str_template::multibyte_to_unicode(), and SQL_COPT_SS_INTEGRATED_SECURITY.

void odbc_dbserver::v_disconnect (  )  [protected, virtual]

closes connection

Implements dbserver_impl.

Definition at line 147 of file odbcsrv.cpp.

References _hdbc, _henv, dbserver_impl::_temp_allocator, byte_allocator::clear_extra(), and v_close().

void odbc_dbserver::v_start_transaction (  )  [protected, virtual]

starts transaction

Implements dbserver_impl.

Definition at line 168 of file odbcsrv.cpp.

References _hdbc, and check_retcode_db.

void odbc_dbserver::v_commit (  )  [protected, virtual]

commits transaction

Implements dbserver_impl.

Definition at line 176 of file odbcsrv.cpp.

References _hdbc, and check_retcode_db.

void odbc_dbserver::v_rollback (  )  [protected, virtual]

rolls back transaction

Implements dbserver_impl.

Definition at line 186 of file odbcsrv.cpp.

References _hdbc, and check_retcode_db.

bool odbc_dbserver::v_is_connect_alive (  )  [protected, virtual]

checks if the connection is alive

Implements dbserver_impl.

Definition at line 196 of file odbcsrv.cpp.

References _hdbc, and dbserver_impl::_is_connect().

void odbc_dbserver::v_before_execute (  )  [protected, virtual]

void odbc_dbserver::v_execute (  )  [protected, virtual]

executes SQL expression

Implements dbserver_impl.

Definition at line 331 of file odbcsrv.cpp.

References _hstmt, dbserver_impl::_sql, dbserver_impl::_temp_allocator, check_retcode, and str_template::multibyte_to_unicode().

void odbc_dbserver::v_close (  )  [protected, virtual]

closes opened query

Implements dbserver_impl.

Definition at line 345 of file odbcsrv.cpp.

References _hstmt.

Referenced by v_disconnect().

void odbc_dbserver::v_replace_quote (  )  [protected, virtual]

void odbc_dbserver::v_bind_one_param ( size_t  index  )  [protected, virtual]

void odbc_dbserver::v_before_bind_columns (  )  [protected, virtual]

before bind columns sometimes we got db specific

Implements dbserver_impl.

Definition at line 302 of file odbcsrv.cpp.

References _bind_cols, dbserver_impl::_bulk_rows, dbserver_impl::_cols, and base_vector< T >::size().

size_t odbc_dbserver::v_get_number_columns (  )  [protected, virtual]

gets number columns in query

Implements dbserver_impl.

Definition at line 1301 of file odbcsrv.cpp.

References _hstmt, and check_retcode.

void odbc_dbserver::v_interrupt_async (  )  [protected, virtual]

terminates asynchronous action

Implements dbserver_impl.

Definition at line 1773 of file odbcsrv.cpp.

References _hstmt.

dbtypes odbc_dbserver::v_native_type_to_client_type ( size_t  native_type  )  [protected, virtual]

converts types

Implements dbserver_impl.

Definition at line 1780 of file odbcsrv.cpp.

References db_binary, db_bool, db_date, db_decimal, db_double, db_float, db_guid, db_numeric, db_sb2, db_sb4, db_sb8, db_string, db_ub1, db_unknown, and db_wstring.

void odbc_dbserver::get_odbc_error ( size_t  code,
SQLHENV  henv,
SQLHDBC  hdbc,
SQLHSTMT  hstmt 
) [static, private]

retrives the error descripton from the ODBC driver

Parameters:
code  error code
henv  ODBC environment handle
hdbc  DB handle
hstmt  SQL statement handle

Definition at line 59 of file odbcsrv.cpp.

References exception::_throw(), and str_template::strcmp().


Member Data Documentation

SQLHENV odbc_dbserver::_henv [private]

ODBC environment handle.

Definition at line 86 of file odbcsrv.h.

Referenced by v_after_execute(), v_connect(), and v_disconnect().

SQLHDBC odbc_dbserver::_hdbc [private]

ODBC DB connection handle.

Definition at line 87 of file odbcsrv.h.

Referenced by v_after_execute(), v_before_execute(), v_commit(), v_connect(), v_disconnect(), v_is_connect_alive(), v_rollback(), and v_start_transaction().

bool odbc_dbserver::_bind_cols [private]

Definition at line 89 of file odbcsrv.h.

Referenced by v_before_bind_columns(), v_bind_one_column(), and v_convert_one_value().


The documentation for this class was generated from the following files:


© Copyright Terimber 2003-.