Skip to content

File cas_cgw_odbc.h

FileList > broker > cas_cgw_odbc.h

Go to the source code of this file

  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <string.h>
  • #include <math.h>
  • #include <unistd.h>
  • #include <fcntl.h>
  • #include <sys/time.h>
  • #include <dlfcn.h>
  • #include <sqltypes.h>
  • #include <sql.h>
  • #include <sqlext.h>
  • #include "cas_handle.h"
  • #include "cas_net_buf.h"
  • #include "dbtype.h"

Classes

Type Name
struct odbc_bind_info
struct t_col_binder
struct t_odbc_col_info

Public Types

Type Name
typedef struct odbc_bind_info ODBC_BIND_INFO
enum SIGN
typedef struct t_col_binder T_COL_BINDER
typedef struct t_odbc_col_info T_ODBC_COL_INFO

Public Functions

Type Name
void cgw_cleanup ()
void cgw_cleanup_binder (T_COL_BINDER * first_col_binding)
int cgw_col_bindings (SQLHSTMT hstmt, SQLSMALLINT num_cols, T_COL_BINDER ** col_binding, T_COL_BINDER ** col_binding_buff)
int cgw_copy_tuple (T_COL_BINDER * src_col_binding, T_COL_BINDER * dst_col_binding)
int cgw_cur_tuple (T_NET_BUF * net_buf, T_COL_BINDER * first_col_binding, int cursor_pos)
int cgw_cursor_close (T_SRV_HANDLE * srv_handle)
int cgw_database_connect (T_DBMS_TYPE dbms_type, const char * connect_url, char * db_name, char * db_user, char * db_passwd)
void cgw_database_disconnect (void)
int cgw_endtran (SQLHDBC hdbc, int tran_type)
int cgw_execute (T_SRV_HANDLE * srv_handle, SQLLEN * row_count)
void cgw_free_stmt (T_SRV_HANDLE * srv_handle)
int cgw_get_col_info (SQLHSTMT hstmt, int col_num, T_ODBC_COL_INFO * col_info)
T_DBMS_TYPE cgw_get_dbms_type ()
int cgw_get_driver_info (SQLHDBC hdbc, SQLUSMALLINT info_type, void * driver_info, SQLSMALLINT size)
int cgw_get_handle (T_CGW_HANDLE ** cgw_handle)
int cgw_get_num_cols (SQLHSTMT hstmt, SQLSMALLINT * num_cols)
int cgw_get_stmt_handle (SQLHDBC hdbc, SQLHSTMT * stmt)
int cgw_init ()
int cgw_init_odbc_handle (void)
int cgw_is_database_connected (void)
T_DBMS_TYPE cgw_is_supported_dbms (char * dbms)
int cgw_make_bind_value (T_CGW_HANDLE * handle, int num_bind, int argc, void ** argv, ODBC_BIND_INFO ** ret_val)
int cgw_row_data (SQLHSTMT hstmt)
int cgw_set_commit_mode (SQLHDBC hdbc, bool auto_commit)
void cgw_set_dbms_type (T_DBMS_TYPE dbms_type)
int cgw_set_execute_info (T_SRV_HANDLE * srv_handle, T_NET_BUF * net_buf, int stmt_type)
int cgw_set_stmt_attr (SQLHSTMT hstmt, SQLINTEGER attr, SQLPOINTER val, SQLINTEGER len)
int cgw_sql_prepare (SQLCHAR * sql_stmt)

Macros

Type Name
define ATTR_NAME_LEN (255)
define CLASS_NAME_LEN (255)
define COL_NAME_LEN (255)
define DECIMAL_DIGIT_MAX_LEN (20) /\* 9223372036854775807 (7[**FFF**](broker__monitor_8c.md#function-timeout) [**FFFF**](broker__monitor_8c.md#function-timeout) [**FFFF**](broker__monitor_8c.md#function-timeout) [**FFFF**](broker__monitor_8c.md#function-timeout)) \*/
define DEFAULT_VALUE_LEN (255)
define MYSQL_CONNECT_URL_FORMAT "DRIVER={%s};SERVER=%s;[**Port**](broker__monitor_8c.md#function-timeout)=%s;[**DATABASE**](broker__monitor_8c.md#function-timeout)=%s;[**USER**](broker__monitor_8c.md#function-timeout)=%s;[**PASSWORD**](broker__monitor_8c.md#function-timeout)=%s;%[**s"**](broker__monitor_8c.md#function-timeout)
define ORACLE_CONNECT_URL_FORMAT "DRIVER={%s};[**DBQ**](broker__monitor_8c.md#function-timeout)=%s;[**Server**](broker__monitor_8c.md#function-timeout)=%s/%s;[**Uid**](broker__monitor_8c.md#function-timeout)=%s;[**Pwd**](broker__monitor_8c.md#function-timeout)=%s;%[**s"**](broker__monitor_8c.md#function-timeout)
define SIZEOF_LONG_INT 8

Public Types Documentation

typedef ODBC_BIND_INFO

typedef struct odbc_bind_info ODBC_BIND_INFO;

enum SIGN

enum SIGN {
    MINUS,
    PLUS
};

typedef T_COL_BINDER

typedef struct t_col_binder T_COL_BINDER;

typedef T_ODBC_COL_INFO

typedef struct t_odbc_col_info T_ODBC_COL_INFO;

Public Functions Documentation

function cgw_cleanup

void cgw_cleanup () 

function cgw_cleanup_binder

void cgw_cleanup_binder (
    T_COL_BINDER * first_col_binding
) 

function cgw_col_bindings

int cgw_col_bindings (
    SQLHSTMT hstmt,
    SQLSMALLINT num_cols,
    T_COL_BINDER ** col_binding,
    T_COL_BINDER ** col_binding_buff
) 

function cgw_copy_tuple

int cgw_copy_tuple (
    T_COL_BINDER * src_col_binding,
    T_COL_BINDER * dst_col_binding
) 

function cgw_cur_tuple

int cgw_cur_tuple (
    T_NET_BUF * net_buf,
    T_COL_BINDER * first_col_binding,
    int cursor_pos
) 

function cgw_cursor_close

int cgw_cursor_close (
    T_SRV_HANDLE * srv_handle
) 

function cgw_database_connect

int cgw_database_connect (
    T_DBMS_TYPE dbms_type,
    const  char * connect_url,
    char * db_name,
    char * db_user,
    char * db_passwd
) 

function cgw_database_disconnect

void cgw_database_disconnect (
    void
) 

function cgw_endtran

int cgw_endtran (
    SQLHDBC hdbc,
    int tran_type
) 

function cgw_execute

int cgw_execute (
    T_SRV_HANDLE * srv_handle,
    SQLLEN * row_count
) 

function cgw_free_stmt

void cgw_free_stmt (
    T_SRV_HANDLE * srv_handle
) 

function cgw_get_col_info

int cgw_get_col_info (
    SQLHSTMT hstmt,
    int col_num,
    T_ODBC_COL_INFO * col_info
) 

function cgw_get_dbms_type

T_DBMS_TYPE cgw_get_dbms_type () 

function cgw_get_driver_info

int cgw_get_driver_info (
    SQLHDBC hdbc,
    SQLUSMALLINT info_type,
    void * driver_info,
    SQLSMALLINT size
) 

function cgw_get_handle

int cgw_get_handle (
    T_CGW_HANDLE ** cgw_handle
) 

function cgw_get_num_cols

int cgw_get_num_cols (
    SQLHSTMT hstmt,
    SQLSMALLINT * num_cols
) 

function cgw_get_stmt_handle

int cgw_get_stmt_handle (
    SQLHDBC hdbc,
    SQLHSTMT * stmt
) 

function cgw_init

int cgw_init () 

function cgw_init_odbc_handle

int cgw_init_odbc_handle (
    void
) 

function cgw_is_database_connected

int cgw_is_database_connected (
    void
) 

function cgw_is_supported_dbms

T_DBMS_TYPE cgw_is_supported_dbms (
    char * dbms
) 

function cgw_make_bind_value

int cgw_make_bind_value (
    T_CGW_HANDLE * handle,
    int num_bind,
    int argc,
    void ** argv,
    ODBC_BIND_INFO ** ret_val
) 

function cgw_row_data

int cgw_row_data (
    SQLHSTMT hstmt
) 

function cgw_set_commit_mode

int cgw_set_commit_mode (
    SQLHDBC hdbc,
    bool auto_commit
) 

function cgw_set_dbms_type

void cgw_set_dbms_type (
    T_DBMS_TYPE dbms_type
) 

function cgw_set_execute_info

int cgw_set_execute_info (
    T_SRV_HANDLE * srv_handle,
    T_NET_BUF * net_buf,
    int stmt_type
) 

function cgw_set_stmt_attr

int cgw_set_stmt_attr (
    SQLHSTMT hstmt,
    SQLINTEGER attr,
    SQLPOINTER val,
    SQLINTEGER len
) 

function cgw_sql_prepare

int cgw_sql_prepare (
    SQLCHAR * sql_stmt
) 

Macro Definition Documentation

define ATTR_NAME_LEN

#define ATTR_NAME_LEN `(255)`

define CLASS_NAME_LEN

#define CLASS_NAME_LEN `(255)`

define COL_NAME_LEN

#define COL_NAME_LEN `(255)`

define DECIMAL_DIGIT_MAX_LEN

#define DECIMAL_DIGIT_MAX_LEN `(20) /* 9223372036854775807 (7 FFF  FFFF  FFFF  FFFF ) */`

define DEFAULT_VALUE_LEN

#define DEFAULT_VALUE_LEN `(255)`

define MYSQL_CONNECT_URL_FORMAT

#define MYSQL_CONNECT_URL_FORMAT `"DRIVER={%s}; SERVER =%s; Port =%s; DATABASE =%s; USER =%s; PASSWORD =%s;% s"`

define ORACLE_CONNECT_URL_FORMAT

#define ORACLE_CONNECT_URL_FORMAT `"DRIVER={%s}; DBQ =%s; Server =%s/%s; Uid =%s; Pwd =%s;% s"`

define SIZEOF_LONG_INT

#define SIZEOF_LONG_INT `8`


The documentation for this class was generated from the following file cubrid/src/broker/cas_cgw_odbc.h