Main Page | Class Hierarchy | Data Structures | File List | Data Fields | Globals | Related Pages

CDB Class Reference

Define methods for accessing the functions of a loaded driver. More...

#include <CDB.h>


Public Member Functions

int bv_bind_by_pos (Tptr res, int pos, tvartype type, Tptr data)
char bv_finished (Tptr res)
int bv_get_count (Tptr res)
char bv_get_filled (Tptr res, int pos)
int bv_get_pos_by_name (Tptr res, const CDBstring &pos, int *res_vec, int *res_vec_size)
int bv_set_unfilled (Tptr res)
 CDB (const CDBstring &driver_name)
 CDB (CDB &c)
 CDB ()
void close_query (Tptr res)
Tptr connect (const CDBstring &conn_str)
int count_cols (Tptr res)
int count_rows (Tptr res)
void disconnect (Tptr conn)
CDBstring error (Tptr conn)
CDBstring error_msg ()
 Retrieve error messages.
int exec_query (Tptr db, Tptr *res, const CDBstring &str_sql)
CDBstring get_driver_name ()
 Get name of used driver object.
driver_func_t get_static_func ()
int getcdbopts ()
int last_error ()
 Retrieve loading errors made by Constructors.
int load (const CDBstring &driver_name)
 Dynamic loading of shared objects driver_*.so.
int load_static (driver_func_t func)
 Static loading of driver_func_t.
int open_query (Tptr db, Tptr *res, const CDBstring &str_sql)
int process (Tptr res)
int read_date (Tptr res, int row, int col, int *year, int *mon, int *day)
int read_datetime (Tptr res, int row, int col, int *year, int *mon, int *day, int *hour, int *min, int *sec)
int read_double (Tptr res, int row, int col, double *d_ptr)
int read_integer (Tptr res, int row, int col, int *p)
int read_isnull (Tptr res, int row, int col)
int read_long_integer (Tptr res, int row, int col, int64_t *p)
CDBstring read_string (Tptr res, int row, int col)
int read_time (Tptr res, int row, int col, int *hour, int *min, int *sec)
int search_col (Tptr res, const CDBstring &fn)
void setopt (Tptr conn, int opt)
CDBstring sqlerr (Tptr res)
int status (Tptr conn)
CDBstring version ()
virtual ~CDB ()

Private Attributes

void * handle
CDBstring mdriver_name
CDBstring merror_msg
int mlast_error
driver_func_t mstatic_func
driver_symbols_tsyms


Detailed Description

Define methods for accessing the functions of a loaded driver.

This class implements the dynamic and static loading of driver's. Internally this class wrapps around driver_symbols_t structure which is initialized by several drivers.


Constructor & Destructor Documentation

CDB  ) 
 

CDB CDB c  ) 
 

CDB const CDBstring driver_name  ) 
 

virtual ~CDB  )  [virtual]
 


Member Function Documentation

int bv_bind_by_pos Tptr  res,
int  pos,
tvartype  type,
Tptr  data
[inline]
 

char bv_finished Tptr  res  )  [inline]
 

int bv_get_count Tptr  res  )  [inline]
 

char bv_get_filled Tptr  res,
int  pos
[inline]
 

int bv_get_pos_by_name Tptr  res,
const CDBstring pos,
int *  res_vec,
int *  res_vec_size
[inline]
 

int bv_set_unfilled Tptr  res  )  [inline]
 

void close_query Tptr  res  )  [inline]
 

Tptr connect const CDBstring conn_str  )  [inline]
 

int count_cols Tptr  res  )  [inline]
 

int count_rows Tptr  res  )  [inline]
 

void disconnect Tptr  conn  )  [inline]
 

CDBstring error Tptr  conn  )  [inline]
 

CDBstring error_msg  ) 
 

Retrieve error messages.

int exec_query Tptr  db,
Tptr res,
const CDBstring str_sql
[inline]
 

CDBstring get_driver_name  ) 
 

Get name of used driver object.

If you loaded a driver dynmically, this method returns the used driver object name.

Returns:
Pointer to the name as char *

driver_func_t get_static_func  )  [inline]
 

int getcdbopts  )  [inline]
 

int last_error  ) 
 

Retrieve loading errors made by Constructors.

If you construct this class with the CDB(const char* driver_name) or CDB(CDB& c), and the class performs a dynmic loading of a driver, there can arise some errors. To retrieve the error code, you call this method. Example:

 CDB *cdb_inst = new CDB("driver_oci.so");
 if ( cdb_inst->last_error() < 1 ) {
 	... // Error handling
 }
 
Returns:
The error code.

int load const CDBstring driver_name  ) 
 

Dynamic loading of shared objects driver_*.so.

This method loads the specified driver. The driver_name is is Normally the name of the shared object to use.

Parameters:
driver_name Name of the shared object file to load.
Returns:
1 on succes, less than on error.

int load_static driver_func_t  func  ) 
 

Static loading of driver_func_t.

This method uses the passed driver function to instanciate a driver_symbol_t to operate with a driver.

Parameters:
func The pointer to the initialization function.
Returns:
1 on succes, less than on error.

int open_query Tptr  db,
Tptr res,
const CDBstring str_sql
[inline]
 

int process Tptr  res  )  [inline]
 

int read_date Tptr  res,
int  row,
int  col,
int *  year,
int *  mon,
int *  day
[inline]
 

int read_datetime Tptr  res,
int  row,
int  col,
int *  year,
int *  mon,
int *  day,
int *  hour,
int *  min,
int *  sec
[inline]
 

int read_double Tptr  res,
int  row,
int  col,
double *  d_ptr
[inline]
 

int read_integer Tptr  res,
int  row,
int  col,
int *  p
[inline]
 

int read_isnull Tptr  res,
int  row,
int  col
[inline]
 

int read_long_integer Tptr  res,
int  row,
int  col,
int64_t p
[inline]
 

CDBstring read_string Tptr  res,
int  row,
int  col
[inline]
 

int read_time Tptr  res,
int  row,
int  col,
int *  hour,
int *  min,
int *  sec
[inline]
 

int search_col Tptr  res,
const CDBstring fn
[inline]
 

void setopt Tptr  conn,
int  opt
[inline]
 

CDBstring sqlerr Tptr  res  )  [inline]
 

int status Tptr  conn  )  [inline]
 

CDBstring version  )  [inline]
 


Field Documentation

void* handle [private]
 

CDBstring mdriver_name [private]
 

CDBstring merror_msg [private]
 

int mlast_error [private]
 

driver_func_t mstatic_func [private]
 

driver_symbols_t* syms [private]
 


Generated on Mon Feb 6 00:30:32 2006 for CDB by  doxygen 1.4.4