linux下使用otl開發oracle資料庫程式

2021-04-14 02:21:00 字數 1141 閱讀 3185

#include

using namespace std;

#include

#define otl_stream_read_iterator_on

#define otl_ora9i // compile otl 4.0/oci9i

#include // include the otl 4.0 header file

#include "db.h"

#include "wdlib/wdlib.h"

#include "pthread.h"

otl_connect db; // connect object

extern pthread_mutex_t db_mutex;

int connectdb(char username, char password, char dbname)

;sprintf(connstr, "%s/%s@%s", username, password, dbname);       

db.rlogon(connstr); // connect to oracle

info(0, "connect db successfully!/n");

} catch(otl_exception& p)

return 0;

}void disconnectdb()

int ep_command_insert(int commtype, unsigned char main_type[10], unsigned char secu_para[10], unsigned char load_len[10], unsigned char sub_type[10], unsigned char ep_id[20], unsigned char object_id[10], unsigned char action[10], unsigned char reserve[20], unsigned char random[10], unsigned char mac[10], unsigned char ep_command[128], int commstatus)

rs.detach(); // detach the itertor from the stream

return 0;

//#endif

OTL使用總結

在vc中訪問oracle,可以使用ado或odbc,如果你比較強大,也可以直接使用oci api,但我個人認為otl是最佳選擇,它是一套資料庫訪問c 模板庫,全部 都在otlv4.h標頭檔案中,通過otl不但可以訪問oracle資料庫 使用oci api 還可以訪問db2,或者使用odbc連線字串訪...

OTL使用總結

otl的原始碼只有乙個標頭檔案 otlv4.h。下面以乙個例子來說明如何使用otl。cpp view plain copy define otl ora10g include void caboutdlg onbnclickedok cstring strnum strnum.format 當前or...

OTL使用總結

在vc中訪問oracle,可以使用ado或odbc,如果你比較強大,也可以直接使用oci api,但我個人認為otl是最佳選擇,它是一套資料庫訪問c 模板庫,全部 都在otlv4.h標頭檔案中,通過otl不但可以訪問oracle資料庫 使用oci api 還可以訪問db2,或者使用odbc連線字串訪...