Hi iam using visual studio 2008. I want to retrieve some data from oracle database using c++. But iam not able to compile the code given below. I dont know where iam lacking. I have already included the path in the projectsetting required to find occi.h and also included the path for dlls. I am using oracle 11g. can any body help me on this. Iam searching for the solution for a solution or guidance from past one week. I googled alt but did'nt goyt any solution. Please see the code below.
Code:
// Connection to DataBase.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include"DbManager.h"
#define WIN32COMMON
#include<iostream>
#include <occi.h>
using namespace oracle::occi;
using namespace std;
class DataBaseConnectionTest
{
public:
void test()
{
const string sqlstring("select * from info ");
try
{
cout<<"Hello"<<'\n';
DbManager *db=new DbManager(system);
OracleServices *os=db->getoracleServices();
Connection *conn=os->connection();
Statement *st=conn->createStatement(sqlstring);
ResultSet *rs=st->executeQuery();
string name;
while(rs->next())
{
name=rs->getString(1);
cout<<name<<" "<<'\n';
}
st->closeResultSet(rs);
conn->terminateStatement(st);
}
catch(SQLException& se)
{
cout<<"Error Occured"<<"\n";
}
}
};
void main()
{
DataBaseConnectionTest *dbc=new DataBaseConnectionTest();
dbc->test();
}
Any help will be greatly appriciated.