database connectivity

hey , i am using this code for database connection but it is giving error




#include "/opt/redknee/home/rel76d1/mediation//3rdparty/ocilib/include/ocilib.h"
int main(void)
{
OCI_Connection *cn;
if (!OCI_Initialize(NULL, NULL, OCI_ENV_DEFAULT))
return EXIT_FAILURE;
//cn = OCI_ConnectionCreate("db", "usr", "pwd", OCI_SESSION_DEFAULT);
cn = OCI_createConnection("rel76d1", "rte", "rted1", OCI_SESSION_DEFAULT);
if (cn != NULL)
{
printf(OCI_GetVersionServer(cn));
printf("Server major version : %i\n", OCI_GetServerMajorVersion(cn));
printf("Server minor version : %i\n", OCI_GetServerMinorVersion(cn));
printf("Server revision version : %i\n", OCI_GetServerRevisionVersion(cn));
printf("Connection version : %i\n", OCI_GetVersionConnection(cn));
/*... application code here ...*/
OCI_ConnectionFree(cn);
}
OCI_Cleanup();
return EXIT_SUCCESS;
}


but on compling it is giving error oci_createConnection() was not declared in this scope.
1) Please enclose your code in code tags, to make it easier to read

2) Hard-coding the full path to the header file in the include statement is clumsy and limiting. It's much better to put the name of the file only, then add the directory containing the header files to your include path.

3) Are the OCI_ functions in a namespace? If so, you'll need to use that namespace identification.

Edit:

4) It looks as though the naming convention for OCI functions has the 5th letter always being upper case. If so, you'll need to change OCI_createConnection to OCI_CreateConnection.
Last edited on
can you please help me how to give a database connection to a c++ code
i am using turbo c++ as an editor and if i have oracle 11g client odbc as a driver , what else i require and how to link these things in a code.

i am facing problem in this a am nw to this things


thanks in advance
Topic archived. No new replies allowed.