Oracle, ODBC and DB2-CLI Template Library (OTL) Usage

Source: Internet
Author: User
OTL use method 1 source http://otl.sourceforge.net/http://otl.sourceforge.net/otlv4_h.zip () 2 install 2.1 Windows XP, vc6.0, oracle8.1.61) unzip the downloaded installation package to C: /program files/Microsoft Visual Studio/vc98/otlv4_h/otlv4.h. 2) Add C:/program files/Microsoft Visual Studio/vc98/otlv4_h in tools> Options> directories> include files under VC. If the OCI path is not set, 3) add C:/Oracle/ora81/OCI/include to tools> Options> directories> include files under VC. 4) add C:/Oracle/ora81/OCI/lib/msvc to tools> Options> directories> library files under VC. 2.2 UNIX Solaris, GCC, oracle9.2 unzip the downloaded installation package. 3. Test Windows XP, vc6.0, and oracle8.1.61 in 3.1. Create a console empty project. Set the type to Win32 console application and finish. 2) Enter OCI. Lib under project> Settings> link> Object/library modules. 3) Copy otl4_examples/ex10_oci8.cpp to the project directory. 4) on the FileView page of the workspace window, right-click ** files, select add files to project from the pop-up menu, and add ex10_oci8.cpp. 5) modify the source Program As follows:

# Include <iostream> // using namespace STD; # include <stdio. h> # define otl_ora8i // compile OTL 4/oci8 # include <otlv4.h> // include the OTL 4 header fileusing namespace STD ;'...... Int main () {otl_connect: otl_initialize (); // initialize OCI environment try {dB. rlogon ("username/password @ Sid"); // connect to Oracle
Figure 0 ‑ 1 the modified Source code 3.2 UNIX Solaris, GCC, oracle9.21) Copy ex10_oci8.cpp to a directory. 2) modify the source file as follows:

# Include <iostream> using namespace STD; # include <stdio. h> # define otl_ora8i // compile OTL 4/oci8 # include "otlv4.h" // include the OTL 4 header fileusing namespace STD ;'...... Int main () {otl_connect: otl_initialize (); // initialize OCI environment try {dB. rlogon ("username/password @ Sid"); // connect to Oracle
Figure 0 ‑ 1 source after modification Code 3) Compile the MAKEFILE file, for example:

ALL: ex10_oci8.cpp g ++ ex10_oci8.cpp/-I $ {ORACLE_HOME}/rdbms/demo-I $ {ORACLE_HOME}/rdbms/public-I $ {ORACLE_HOME}/Network/public/-L $ {ORACLE_HOME}/lib32-lclntsh
Figure 0 Example 2 makefile
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.