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

driver_symbols Struct Reference

Structure to driver callback functions. More...

#include <cdb_driver_symbol.h>


Data Fields

int(* bv_bind_by_pos )(Tptr, int, tvartype, Tptr)
 Bind variable by position.
char(* bv_finished )(Tptr)
int(* bv_get_count )(Tptr)
char(* bv_get_filled )(Tptr, int)
int(* bv_get_pos_by_name )(Tptr, const Mchar *, int *, int *)
 Examine positions of named variables.
int(* bv_set_unfilled )(Tptr)
void(* close_query )(Tptr)
 Terminate rowset, abort query, .
Tptr(* connect )(const Mchar *)
 Create new database connection to specified source.
int(* count_cols )(Tptr)
 Function to count cols in rowset.
int(* count_rows )(Tptr)
 Function to count rows in rowset.
void(* disconnect )(Tptr)
 Terminate applied connection instance.
const Mchar *(* error )(Tptr)
 Retrieve error message from connection instance.
int(* exec_query )(Tptr, Tptr *, const Mchar *)
 Exec query to database.
int(* getcdbopts )(void)
 Retrieve the options that the driver offers to CDB api.
int(* open_query )(Tptr, Tptr *, const Mchar *)
 Open query to database.
int(* process )(Tptr)
int(* read_date )(Tptr, int, int, int *, int *, int *)
 Read date value from rowset.
int(* read_datetime )(Tptr, int, int, int *, int *, int *, int *, int *, int *)
 Read datetime value from rowset.
int(* read_double )(Tptr, int, int, double *)
 Read double value from rowset.
int(* read_integer )(Tptr, int, int, int *)
 Read integer value from rowset.
int(* read_isnull )(Tptr, int, int)
 Read NULL value from rowset.
int(* read_long_integer )(Tptr, int, int, int64_t *)
 Read long integer (int64_t) value from rowset.
const Mchar *(* read_string )(Tptr, int, int)
 Read double value from rowset.
int(* read_time )(Tptr, int, int, int *, int *, int *)
 Read time value from rowset.
int(* search_col )(Tptr, const Mchar *)
 Search for index of column by name.
void(* setopt )(Tptr, int)
 Set options for special driver operations like debug or specific error handling.
const Mchar *(* sqlerr )(Tptr)
 Retrieve errors from sql processor, client library or generated messages from CDB api corresponding to the query/rowset.
int(* status )(Tptr)
 Retrieve status of connection.
const Mchar * version


Detailed Description

Structure to driver callback functions.

This structure defines the main interface between api (CDB classes) and driver. Implement functions defined in this structure to build your own driver.

It's really easy!

Author:
Joerg Hundertmarck, <joerg@hirnfrei.org>
Date:
26.01.2005


Field Documentation

int(* bv_bind_by_pos)(Tptr, int, tvartype, Tptr)
 

Bind variable by position.

Parameters:
first Rowset
second Position of variable
third Datatype
fourth Pointer to data storage
Returns:
0 on success other on error.

char(* bv_finished)(Tptr)
 

int(* bv_get_count)(Tptr)
 

char(* bv_get_filled)(Tptr, int)
 

int(* bv_get_pos_by_name)(Tptr, const Mchar *, int *, int *)
 

Examine positions of named variables.

Parameters:
first Rowset
second name
third pointer to result vector
fourth pointer to result count
Returns:
1 If found, 0 if not found, smaller than 0 if error.

int(* bv_set_unfilled)(Tptr)
 

void(* close_query)(Tptr)
 

Terminate rowset, abort query, .

.. do anything I have forgotten to implement in the otherfunctions clean up all recources thats allocated by query or it implementations

Parameters:
first Rowset

Tptr(* connect)(const Mchar *)
 

Create new database connection to specified source.

Parameters:
first Database connection string
Returns:
Pointer to the connection instance

int(* count_cols)(Tptr)
 

Function to count cols in rowset.

Parameters:
first Pointer to the rowset retrieved by open
Returns:
Row count

int(* count_rows)(Tptr)
 

Function to count rows in rowset.

Parameters:
first Pointer to the rowset retrieved by open
Returns:
Row count

void(* disconnect)(Tptr)
 

Terminate applied connection instance.

Parameters:
first Connection instance

const Mchar*(* error)(Tptr)
 

Retrieve error message from connection instance.

Parameters:
first Connection instance
Returns:
Error message as string

int(* exec_query)(Tptr, Tptr *, const Mchar *)
 

Exec query to database.

Opens a database query without returning some rows.

Parameters:
first Connection instance
second Pointer to the rowset instance.
third The sql statement
Returns:
1 if success.

int(* getcdbopts)(void)
 

Retrieve the options that the driver offers to CDB api.

Returns:
Bit mask of options

int(* open_query)(Tptr, Tptr *, const Mchar *)
 

Open query to database.

Opens a database query with returning some rows.

Parameters:
first Connection instance
second Pointer to the rowset instance.
third The sql statement
Returns:
1 if success.

int(* process)(Tptr)
 

int(* read_date)(Tptr, int, int, int *, int *, int *)
 

Read date value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
fourth The year
fifth The month
sixth The day
Returns:
1 on success, other if error

int(* read_datetime)(Tptr, int, int, int *, int *, int *, int *, int *, int *)
 

Read datetime value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
fourth The year
fifth The month
sixth The day
seventh The hour
eighth The minute
ninth The second
Returns:
1 on success, other if error

int(* read_double)(Tptr, int, int, double *)
 

Read double value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
fourth The value
Returns:
1 on success, other if error

int(* read_integer)(Tptr, int, int, int *)
 

Read integer value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
fourth The value
Returns:
1 on success, other if error

int(* read_isnull)(Tptr, int, int)
 

Read NULL value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
Returns:
1 if column is NULL, if NOT NULL it returns 0, others on errors

int(* read_long_integer)(Tptr, int, int, int64_t *)
 

Read long integer (int64_t) value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
fourth The value
Returns:
1 on success, other if error

const Mchar*(* read_string)(Tptr, int, int)
 

Read double value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
Returns:
The value, NULL if error

int(* read_time)(Tptr, int, int, int *, int *, int *)
 

Read time value from rowset.

Parameters:
first Rowset
second Row to fetch
third Column
fourth The hour
fifth The minute
sixth The second
Returns:
1 on success, other if error

int(* search_col)(Tptr, const Mchar *)
 

Search for index of column by name.

Parameters:
first Rowset
second Column name
Returns:
third Index

void(* setopt)(Tptr, int)
 

Set options for special driver operations like debug or specific error handling.

Parameters:
first Pointer to connection instance
second Option flag to set

const Mchar*(* sqlerr)(Tptr)
 

Retrieve errors from sql processor, client library or generated messages from CDB api corresponding to the query/rowset.

Parameters:
first Rowset

int(* status)(Tptr)
 

Retrieve status of connection.

Returns:
1 if connection is etablished

const Mchar* version
 


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