Click here to Skip to main content
12,754,607 members (35,383 online)
Click here to Skip to main content
Add your own
alternative version


33 bookmarked
Posted 27 Sep 2002

C++ wrapper for Oracle's OCI Interface

, 27 Sep 2002
Rate this:
Please Sign up or sign in to vote.
This article will provide a cross platform C++ wrapper for Oracle's OCI interface.


With this C++ wrapper, you can easily do the following:

  • Connect/disconnect to an Oracle server;
  • Execute SQL select/insert/update/delete commands;
  • Store the query result in a simple linked list;

This project is a cross platform implementation.

class  ObList ;
class  Record ;
class  RecordSet;
int Connect();
int Connect(char *user, char *pass, char *service);
void DisConnect();
int ExecCommand(char* cmdbuf);


#include <stdio.h>
#include "dbclient.h"

int main(int argc, char* argv[])

    printf("Connect OK.\n");
    RecordSet set;
    set.Open("select * from EMP");
    for(int k=0;k<set.GetRecordsCount();k++)
        Record *pRec=set.GetRecord(k);
        for(int l=0;l<pRec->GetFieldsCount();l++)
    return 0;

If you are interested in this article, and want to get details, contact me at or


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
6 years Programer With VC++

You may also be interested in...

Comments and Discussions

Questionlinking error :( Pin
su_r00t5-Feb-09 6:19
membersu_r00t5-Feb-09 6:19 
Generalmy email had changed!w Pin
yt_lhj29-Apr-08 22:41
memberyt_lhj29-Apr-08 22:41 
QuestionRe: insert? Pin
zuzulica3-Jan-07 12:03
memberzuzulica3-Jan-07 12:03 
Questioninsert? Pin
cata_100024-Nov-06 11:57
membercata_100024-Nov-06 11:57 
M_Nuaimi25-Apr-06 14:23
memberM_Nuaimi25-Apr-06 14:23 
GeneralOracle OCI library Pin
maacha13-Apr-05 19:00
membermaacha13-Apr-05 19:00 
GeneralRe: Oracle OCI library Pin
Michael B Pliam22-Feb-07 21:34
memberMichael B Pliam22-Feb-07 21:34 
GeneralCLOB Datatype Pin
Leong Hoe Wai18-Aug-04 20:26
memberLeong Hoe Wai18-Aug-04 20:26 
Questionhow i can do insert? Pin
andresfecas26-Apr-04 15:03
memberandresfecas26-Apr-04 15:03 
GeneralUnable to link OCI containing library Pin
Vijaylakshmi18-May-03 20:10
memberVijaylakshmi18-May-03 20:10 
GeneralRe: Unable to link OCI containing library Pin
ThoMay2-Mar-05 20:16
memberThoMay2-Mar-05 20:16 
Generalmemory bug in source code Pin
scy1-Mar-03 1:33
memberscy1-Mar-03 1:33 
GeneralRe: memory bug in source code Pin
scy6-Jan-04 15:51
memberscy6-Jan-04 15:51 
GeneralA simple linklist; Pin
Madmaximus16-Dec-02 5:38
memberMadmaximus16-Dec-02 5:38 
GeneralRe: A simple linklist; Pin
yt_lhj16-Dec-02 19:14
memberyt_lhj16-Dec-02 19:14 
QuestionHow can I do ?? Pin
ShanGuohui24-Oct-02 4:11
sussShanGuohui24-Oct-02 4:11 
QuestionHow do you handle two connections ? Pin
Miroslav Rajcic29-Sep-02 22:03
memberMiroslav Rajcic29-Sep-02 22:03 
AnswerRe: How do you handle two connections ? Pin
lihaijian29-Sep-02 22:30
memberlihaijian29-Sep-02 22:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170217.1 | Last Updated 28 Sep 2002
Article Copyright 2002 by lihaijian
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid