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

mysql_dbserver Class Reference

implements the dbserver interface for MYSQL More...

#include <mysqlsrv.h>

Inheritance diagram for mysql_dbserver:

dbserver_impl dbserver terimber_thread_employer terimber_log_helper terimber_log

List of all members.

Public Member Functions

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

Protected Member Functions

virtual void v_connect (bool trusted_connection, const char *connection_string)
 database specific
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_before_bind_columns ()
 before bind columns sometimes we got db specific
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_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 index, 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

Private Member Functions

void parse_connection_string (const char *connection_string, string_t &user, string_t &password, string_t &host, unsigned short &port, string_t &database)
 parser connection string

Private Attributes

MYSQL * _desc
 descriptor pointer
MYSQL_STMT * _stmt
 statement pointer
_vector< MYSQL_BIND > _param_binders
 parameter binders
_vector< MYSQL_BIND > _column_binders
 column binders


Detailed Description

implements the dbserver interface for MYSQL

Definition at line 39 of file mysqlsrv.h.


Constructor & Destructor Documentation

mysql_dbserver::mysql_dbserver ( size_t  ident  ) 

constructor

Parameters:
ident  server ident

Definition at line 53 of file mysqlsrv.cpp.

mysql_dbserver::~mysql_dbserver (  )  [virtual]


Member Function Documentation

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

database specific

Implements dbserver_impl.

Definition at line 69 of file mysqlsrv.cpp.

References _desc, check_retcode_db, base_string< T >::length(), and parse_connection_string().

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

closes connection

Implements dbserver_impl.

Definition at line 103 of file mysqlsrv.cpp.

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

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

starts transaction

Implements dbserver_impl.

Definition at line 118 of file mysqlsrv.cpp.

References _desc, and check_retcode_db.

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

commits transaction

Implements dbserver_impl.

Definition at line 125 of file mysqlsrv.cpp.

References _desc, and check_retcode_db.

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

rolls back transaction

Implements dbserver_impl.

Definition at line 132 of file mysqlsrv.cpp.

References _desc, and check_retcode_db.

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

checks if the connection is alive

Implements dbserver_impl.

Definition at line 139 of file mysqlsrv.cpp.

References dbserver_impl::_is_connect().

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

before bind columns sometimes we got db specific

Implements dbserver_impl.

Definition at line 567 of file mysqlsrv.cpp.

References dbserver_impl::_cols, _column_binders, dbserver_impl::_columns_allocator, _vector< T, A >::resize(), and base_vector< T >::size().

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

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

closes opened query

Implements dbserver_impl.

Definition at line 222 of file mysqlsrv.cpp.

References _column_binders, _param_binders, _stmt, and _vector< T, A >::clear().

Referenced by v_disconnect(), and v_interrupt_async().

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

gets number columns in query

Implements dbserver_impl.

Definition at line 664 of file mysqlsrv.cpp.

References _stmt.

void mysql_dbserver::v_get_one_column_info ( size_t  index  )  [protected, virtual]

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

terminates asynchronous action

Implements dbserver_impl.

Definition at line 937 of file mysqlsrv.cpp.

References v_close().

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

converts types

Implements dbserver_impl.

Definition at line 945 of file mysqlsrv.cpp.

References db_binary, db_date, db_decimal, db_double, db_float, db_sb1, db_sb2, db_sb4, db_sb8, db_string, and db_unknown.

void mysql_dbserver::parse_connection_string ( const char *  connection_string,
string_t user,
string_t password,
string_t host,
unsigned short &  port,
string_t database 
) [private]

parser connection string

Parameters:
connection_string  input connection string
user  [out] user
password  [out] password
host  [out] host
port  [out] port
database  [out] database

Definition at line 991 of file mysqlsrv.cpp.

References base_string< T >::assign(), base_string< T >::length(), os_minus_one, str_template::strlen(), and str_template::strscan().

Referenced by v_connect().


Member Data Documentation

MYSQL* mysql_dbserver::_desc [private]

descriptor pointer

Definition at line 86 of file mysqlsrv.h.

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

_vector< MYSQL_BIND > mysql_dbserver::_param_binders [private]

parameter binders

Definition at line 88 of file mysqlsrv.h.

Referenced by v_bind_one_param(), v_close(), and v_replace_quote().

_vector< MYSQL_BIND > mysql_dbserver::_column_binders [private]

column binders

Definition at line 89 of file mysqlsrv.h.

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


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


© Copyright Terimber 2003-.