Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/articles/cpp-tutorials/)
-   -   Connect C++ with Oracle (http://www.go4expert.com/articles/connect-cpp-oracle-t5442/)

Shishir191 7May2008 17:05

Re: Connect C++ with Oracle
 
Quote:

Originally Posted by Shishir191
Thanks for your good comments.

Thanks to all

ZeroMaru 29Aug2008 01:06

Re: Connect C++ with Oracle
 
I tried compiling this with:

devc++
miscrosoft visual studio 2003 (vc++ 7)
microsoft visual studio 2005 (8)
microsoft visual studio 2008 (9)

i dont know if im doing somthing wrong or what, but i keep getting this errors:
^
Code:

d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(31) : error C2065: 'DbManager' : identificador no declarado
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(31) : error C2065: 'dbm' : identificador no declarado
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(33) : error C2065: 'OracleServices' : identificador no declarado
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(33) : error C2065: 'oras' : identificador no declarado
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(44) : error C2061: error de sintaxis : identificador 'DbManager'
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(44) : error C3861: 'dbm': no se encontró el identificador, ni siquiera con búsqueda dependiente de argumentos
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(46) : error C2227: el operando izquierdo de '->getOracleServices' debe señalar a class/struct/union
        el tipo es ''unknown-type''
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(46) : error C3861: 'oras': no se encontró el identificador, ni siquiera con búsqueda dependiente de argumentos
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(46) : error C3861: 'dbm': no se encontró el identificador, ni siquiera con búsqueda dependiente de argumentos
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(50) : error C2227: el operando izquierdo de '->connection' debe señalar a class/struct/union
        el tipo es ''unknown-type''
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(50) : error C3861: 'oras': no se encontró el identificador, ni siquiera con búsqueda dependiente de argumentos
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(109) : error C2541: 'delete' : no se pueden eliminar objetos que no sean punteros
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(109) : error C3861: 'dbm': no se encontró el identificador, ni siquiera con búsqueda dependiente de argumentos
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(114) : error C3861: 'dbm': no se encontró el identificador, ni siquiera con búsqueda dependiente de argumentos
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(116) : error C2227: el operando izquierdo de '->rollbackActions' debe señalar a class/struct/union
        el tipo es ''unknown-type''
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(116) : error C3861: 'dbm': no se encontró el identificador, ni siquiera con búsqueda dependiente de argumentos
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(119) : error C2061: error de sintaxis : identificador 'ExoException'
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(119) : error C2310: los controladores de tipo catch deben especificar un tipo
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(121) : error C2065: 'ex1' : identificador no declarado
d:\rcocchiararo\Mis documentos\Visual Studio Projects\test\test.cpp(121) : error C2228: el operando izquierdo de '.getExceptionText' debe tener el tipo class/struct/union
        el tipo es ''unknown-type''

is dbmanager.h or some other library responsable for defining all those variables/things ?

i have tried with oracle client and oracle server 10g installed.
I downloaded occi for visual studio 2005 (vs8), and well, i dont know what else to do :(

ZeroMaru 29Aug2008 01:15

Re: Connect C++ with Oracle
 
to bad i see no edit button, anyway, i forgot to mention that im new to visual studio, so i may be missing some configuration or chosing the wrong type of project, dunno :(

shabbir 29Aug2008 09:19

Re: Connect C++ with Oracle
 
Quote:

Originally Posted by ZeroMaru
to bad i see no edit button, anyway, i forgot to mention that im new to visual studio, so i may be missing some configuration or chosing the wrong type of project, dunno :(

It will come when you reach a double digit post count.

ZeroMaru 29Aug2008 22:40

Re: Connect C++ with Oracle
 
i see

(i was kinda exited about a posible solution for my "problem" when i saw i had a mail from this forum :p )

ZeroMaru 29Aug2008 22:42

Re: Connect C++ with Oracle
 
ahhhhhhh heck

the moment i finished posting the last mesage i saw i had a reply on another forum telling me this about my problem:

Quote:

That's simply because DbManager and OracleServices are not OCCI classes, but likely wrappers around OCCI classes from the poster.

For pure OCCI examples, look in your server install, in RDBMS\demo\occidml.cpp for example on windows. --DD
any ideas about that either ? i find it strange that this example is all over the web and im the only one unable to compile it.

xpi0t0s 2Oct2008 23:15

Re: Connect C++ with Oracle
 
You're not the only one unable to compile it. The code is dependent on dbmanager.h and won't build without it, and dbmanager.h (and any library or other source code it relates to) is not referenced anywhere. Simply removing #include <dbmanager.h> WON'T solve the problem because there are references within the code, i.e.:
Code:

DbManager* dbm = NULL;
dbm = new DbManager(userName);
oras = dbm->getOracleServices();
Connection * conn = oras->connection();
delete dbm;
dbm->rollbackActions(ex, stmt, resultSet);

OP: how about providing dbmanager.h and dbmanager.cpp, or at least stating where it can be found, so that people can actually use this example?

imrose_suleman 18Oct2008 11:26

Re: Connect C++ with Oracle
 
created an employee table in sql and coded in cpp....i compiled using g++ compiler...but getting lot of errors ....can u pls help me out..

imrose_suleman 18Oct2008 11:32

Re: Connect C++ with Oracle
 
there is no clear solution to this problem..still unable to fix this prob in comp....
i need to do case study..and i need it urgently...

xpi0t0s 18Oct2008 12:57

Re: Connect C++ with Oracle
 
I'm trying to fix the code but I keep getting unexplained crashes.
In the meantime use some of the OCCI demo programs from $ORACLE_HOME/rdbms/demo. In 10g these are installed from the Companion disk.


All times are GMT +5.5. The time now is 19:27.