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

db.h File Reference

#include "allinc.h"
#include "threadpool/thread.h"
#include "base/common.h"
#include "base/vector.h"
#include "base/list.h"
#include "base/except.h"
#include "db/dbaccess.h"
#include "dbvalue.h"

Go to the source code of this file.

Classes

class  binder
 orvide functionality for binding sql parameters More...
class  dbserver_impl
 implements most of the methods of the dbserver interface More...
class  dbserver_impl::callback_finder
 class help to find callback More...
class  dbserver_impl::callback_fire
 class help the stl algorithm for_each to fire events More...
class  db_arg
 contain login information More...
class  db_entry
 contain login information More...
class  db_creator< T >
 db creator More...

Defines

#define DB_TRY   try {
 macros to handle exception situation
#define DB_CATCH
#define DB_CATCH_DB
#define DB_CATCH_EX

Typedefs

typedef vector< binderparams_t
 vector of binders
typedef _vector< binderbinders_t
 vector of binders with external allocator
typedef list< binders_tbulk_params_t
 list of binders
typedef _list< _vector
< terimber_db_value > > 
recordset_list_t
 list of rows with external allocator where row is a vector of db values

Enumerations

enum  module_state { STATE_OK, STATE_WORKING, STATE_INTERRUPTED }
 state of module More...

Functions

BEGIN_TERIMBER_NAMESPACE bool is_param_in (db_param_type x)
 checks if this is input parameter
bool is_param_out (db_param_type x)
 checks if this is output parameter

Variables

const size_t ex_custom = 0
 custom exception
const size_t ex_invalid = 1
 invalid module state
const size_t ex_not_init = 2
 module is not intialized
const size_t ex_already_init = 3
 module is already initilaized
const size_t ex_not_connect = 4
 module is not connected
const size_t ex_already_connect = 5
 module is already connected
const size_t ex_not_transaction = 6
 module is not in transaction
const size_t ex_already_transaction = 7
 module is alrady in transacion
const size_t ex_not_sql_open = 8
 module is not in open state
const size_t ex_already_sql_open = 9
 module is already open sql statement
const size_t ex_sql_in_action = 10
 module is processing sql statement
const size_t ex_bad_pointer = 11
 invalid pointer
const size_t ex_invalid_param_count = 12
 number of parameters in sql statement or stored procedure does not math actually binded parameters
const size_t ex_timeout = 13
 timeout occurred
const size_t ex_unknown_server_type = 14
 index out of bounderies
const size_t ex_out_of_bounders = 15
exception_table dbMsgTable
 exception map


Define Documentation

#define DB_CATCH

Value:

return true; } \
catch( exception& x ) { _code = x.get_code(); _error = x.what(); _set_action(ACTION_NONE); _set_state(STATE_OK); } \
catch(...) { _error = "Unknown Exception"; } return false;

Definition at line 86 of file db.h.

Referenced by dbserver_impl::close_sql(), dbserver_impl::exec_proc(), dbserver_impl::exec_sql(), dbserver_impl::fetch_data(), dbserver_impl::open_proc(), and dbserver_impl::open_sql().

#define DB_CATCH_DB

Value:

return true; } \
catch( exception& x ) { _code = x.get_code(); _error = x.what(); } \
catch(...) { _error = "Unknown Exception"; } return false;

Definition at line 90 of file db.h.

Referenced by dbserver_impl::commit(), dbserver_impl::connect(), dbserver_impl::disconnect(), dbserver_impl::rollback(), and dbserver_impl::start_transaction().

#define DB_CATCH_EX

Value:

} catch( exception& x ) { _code = x.get_code(); _error = x.what(); } \
catch(...) { _error = "Unknown Exception"; }

Definition at line 94 of file db.h.


Typedef Documentation

vector of binders with external allocator

Definition at line 312 of file db.h.

list of binders

Definition at line 315 of file db.h.

vector of binders

Definition at line 309 of file db.h.

list of rows with external allocator where row is a vector of db values

Definition at line 319 of file db.h.


Enumeration Type Documentation

state of module

Enumerator:
STATE_OK  module is OK
STATE_WORKING  module is processing asynchronous request
STATE_INTERRUPTED  the asynchronous request has been interrupted

Definition at line 76 of file db.h.


Function Documentation

BEGIN_TERIMBER_NAMESPACE bool is_param_in ( db_param_type  x  )  [inline]

checks if this is input parameter

Parameters:
x  in/out parameter property

Definition at line 46 of file db.h.

References db_param_in, and db_param_in_out.

Referenced by odbc_dbserver::v_bind_one_param().

bool is_param_out ( db_param_type  x  )  [inline]


Variable Documentation

const size_t ex_already_connect = 5

module is already connected

Definition at line 102 of file db.h.

Referenced by dbserver_impl::_check_disconnect().

const size_t ex_already_init = 3

module is already initilaized

Definition at line 100 of file db.h.

const size_t ex_already_sql_open = 9

module is already open sql statement

Definition at line 106 of file db.h.

Referenced by dbserver_impl::_check_close().

const size_t ex_already_transaction = 7

module is alrady in transacion

Definition at line 104 of file db.h.

Referenced by dbserver_impl::_check_out_transaction().

const size_t ex_bad_pointer = 11

invalid pointer

Definition at line 108 of file db.h.

const size_t ex_custom = 0

custom exception

Definition at line 97 of file db.h.

const size_t ex_invalid = 1

invalid module state

Definition at line 98 of file db.h.

Referenced by dbserver_impl::_check_state().

const size_t ex_invalid_param_count = 12

number of parameters in sql statement or stored procedure does not math actually binded parameters

Definition at line 109 of file db.h.

const size_t ex_not_connect = 4

module is not connected

Definition at line 101 of file db.h.

Referenced by dbserver_impl::_check_connect().

const size_t ex_not_init = 2

module is not intialized

Definition at line 99 of file db.h.

const size_t ex_not_sql_open = 8

module is not in open state

Definition at line 105 of file db.h.

Referenced by dbserver_impl::_check_open().

const size_t ex_not_transaction = 6

module is not in transaction

Definition at line 103 of file db.h.

Referenced by dbserver_impl::_check_in_transaction().

const size_t ex_out_of_bounders = 15

Definition at line 112 of file db.h.

const size_t ex_sql_in_action = 10

module is processing sql statement

Definition at line 107 of file db.h.

Referenced by dbserver_impl::_check_action().

const size_t ex_timeout = 13

timeout occurred

Definition at line 110 of file db.h.

const size_t ex_unknown_server_type = 14

index out of bounderies

Definition at line 111 of file db.h.



© Copyright Terimber 2003-.