Oracle C++ Call Interface. Programmer's Guide by Raphaely D., Gregoire J.

By Raphaely D., Gregoire J.

The Oracle C++ name Interface (OCCI) is an program programming interface (API) that enables functions written in C++ to have interaction with a number of Oracle database servers. OCCI offers your courses the facility to accomplish the complete variety of database operations which are attainable with an Oracle database server, together with SQL assertion processing and item manipulation.

Show description

Read or Download Oracle C++ Call Interface. Programmer's Guide PDF

Best programming: programming languages books

Objektorientierte Programmiersprache C++: Vollständige Einführung anhand von Beispielen (VDI-Buch) (German Edition)

In diesem Werk werden alle Aspekte der Sprache C++ behandelt, deshalb ist das Buch ebenso für Einsteiger, mit oder ohne Vorkenntnisse über eine andere Programmiersprache, als auch für Umsteiger von anderen Programmiersprachen bzw. C-Programmierer geeignet. Die Darstellung der Sachverhalte erfolgt knapp und systematisch, die Beispiele sind kurz, prägnant und compiler- unabhängig und auf allen Rechnern mit C++ 2.

Extra resources for Oracle C++ Call Interface. Programmer's Guide

Example text

Stmt->closeResultSet(rs); conn->terminateStatement(stmt); env->terminateConnection(conn); } Environment::terminateEnvironment(env); You can use the mode parameter of the createEnvironment method to specify that your application: ■ Runs in a threaded environment (THREADED_MUTEXED or THREADED_ UNMUTEXED) ■ Uses objects (OBJECT) ■ Utilizes shared data structures (SHARED) The mode can be set independently in each environment. Opening and Closing a Connection The Environment class is the factory class for creating Connection objects.

You effect this either by setting the number of rows to be prefetched (setPrefetchRowCount), or by setting the memory size to be used for prefetching (setPrefetchMemorySize). If you set both of these attributes, then the specified number of rows are prefetched unless the specified memory limit is reached first. If the specified memory limit is reached first, then the prefetch returns as many rows as will fit in the memory space defined by the call to the setPrefetchMemorySize method. By default, prefetching is turned on, and the database fetches an extra row all the time.

The following example invokes the setString and setInt methods to input the values of these types into the first and second parameters. To insert a row: stmt->setString(1, “Bananas”); stmt->setInt(2, 5); // value for first parameter // value for second parameter Having specified the parameters, you insert values into the row: Relational Programming 2-9 Types of SQL Statements in the OCCI Environment stmt->executeUpdate(); // execute statement To insert another row: stmt->setString(1, “Apples”); stmt->setInt(2, 9); // value for first parameter // value for second parameter Having specified the parameters, you again insert values into the row: stmt->executeUpdate(); // execute statement If your application is executing the same statement repeatedly, then avoid changing the input parameter types because a rebind is performed each time the input type changes.

Download PDF sample

Rated 4.69 of 5 – based on 4 votes