Oracle
C++ Call Interface (OCCI)
Are you interested in creating
applications with the speed of OCI, but want seamless integration with
C++? The Oracle C++ Call Interface offers C++ developers a high
performance connection to the Oracle database in a well-designed Object
Oriented interface.
A Simple Useful OCCI
Program
//create environment and
connection
Environment* env =
Environment::createEnvironment();
Connection* conn =
env->createConnection( "scott", "tiger" );
cout << "Environment and
Connection created" << endl;
//execute a SQL statement
Statement* stmt =
conn->createStatement();
stmt->setSQL("INSERT into FRUITS
(fruit, amt) VALUES ('apple', 10)");
stmt->executeUpdate();
conn->terminateStatement(stmt);
//terminate environment
and connection
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
cout << "Environment and
Connection terminated" << endl;
The above OCCI program is one of the simplest
useful programs
possible. This application connects to the Oracle Database
server, does an INSERT, and disconnects. Thus, the program does
all the basic tasks any database application would need - in 8
lines of code.
OCCI offers to developers the opportunity to
create complex yet
easy-to-maintain high-performance applications that follow the native
C++ Object Oriented style.
|