• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            牽著老婆滿街逛

            嚴以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            使用OTL來訪問數據庫

            來源:http://read.newbooks.com.cn/info/157869.html

            OTL介紹:
            OTL Oracle, Odbc and DB2-CLI Template Library 的縮寫,是一個C++編譯中操控關系數據庫的模板庫,它目前幾乎支持所有的當前各種主流數據庫,例如Oracle, MS SQL Server, Sybase, Informix, MySQL, DB2, Interbase / Firebird, PostgreSQL, SQLite, SAP/DB, TimesTen, MS ACCESS等等。OTL中直接操作Oracle主要是通過Oracle提供的OCI接口進行,進行操作DB2數據庫則是通過CLI接口來進行,至于MS的數據庫和其它一些數據庫,則OTL只提供了ODBC來操作的方式。當然OracleDB2也可以由OTL間接使用ODBC的方式來進行操縱。

            MS Windows and Unix 平臺下,OTL目前支持的數據庫版本主要有:Oracle 7 (直接使用 OCI7), Oracle 8 (直接使用 OCI8), Oracle 8i (直接使用OCI8i), Oracle 9i (直接使用OCI9i), Oracle 10g (直接使用OCI10g), DB2 (直接使用DB2 CLI), ODBC 3.x ,ODBC 2.5OTL最新版本為4.0,參見http://otl.sourceforge.net/,下載地址http://otl.sourceforge.net/otlv4_h.zip
            優點:
                  a.
            跨平臺
                  b.
            運行效率高,與C語言直接調用API相當
                  c.
            開發效率高
                  d.
            部署容易,不需要ADO組件,不需要.net framework
                 
            現提供有501個使用范例可參考http://otl.sourceforge.net/otl4_mssql_examples.htm

            OTL的使用:

               OTL使用起來很簡單,使用不同的數據庫連接(連接字符串格式可以參考:http://www.connectionstrings.com/),主要是根據需要在程序開始的宏定義來指定的。 OTL是首先根據這個宏定義來初始化數據庫連接環境。 OTL中用來區分連接方式的宏定義主要有下面這些:
             OTL_ORA7, OTL_ORA8, OTL_ODBC, OTL_DB2_CLI, OTL_ODBC_MYSQL...

            不同的宏對應的數據庫API,具體說明如下:

            宏定義名

            說明

            OTL_DB2_CLI

            for DB2 Call Level Interface (CLI)

            OTL_INFORMIX_CLI

            for Informix Call Level Interface for Unix (when  OTL_ODBC_UNIX is enabled).

            OTL_IODBC_BSD

            for ODBC on BSD Unix, when iODBC package is used

            OTL_ODBC

            for ODBC

            OTL_ODBC_MYSQL

            for MyODBC/MySQL. The difference between OTL_ODBC_MYSQL and OTL_ODBC is that transactional ODBC function calls are turned off for OTL_ODBC_MYSQL, since MySQL does not have transactions

            OTL_ODBC_
            POSTGRESQL

            for the PostgreSQL ODBC driver 3.5 (and higher) that are connected to PostgerSQL 7.4 / 8.0  (and higher)  servers.

            OTL_ODBC_UNIX

            for ODBC bridges in Unix

            OTL_ODBC_zOS

            for ODBC on IBM zOS.

            OTL_ODBC_XTG_IBASE6

            for Interbase 6.x via XTG Systems'  ODBC driver. The reason for introducing this #define is that the ODBC driver is the only Open Source ODBC driver for Interbase. Other drivers, like Easysoft's ODBC for Interbase, are commercial products, and it beats the purpose of using Interbase, as an Open Source.database server.

            OTL_ORA7

            for OCI7

            OTL_ORA8

            for OCI8

            OTL_ORA8I

            for OCI8i

            OTL_ORA9I

            for OCI9i. All code that compiles and works under #define OTL_ORA7, OTL_ORA8, and OTL_ORA8I, should work when OTL_ORA9I is used

            OTL_ORA10G

            for OCI10g. All code that compiles and works  under #define OTL_ORA7, OTL_ORA8, OTL_ORA8I, OTL_ORA9I, should work with OTL_ORA10G.

            OTL_ORA10G_R2

            for OCI10g, Release 2 (Oracle 10.2). All code that compiles and works  under #define OTL_ORA7, OTL_ORA8, OTL_ORA8I, OTL_ORA9I, and OTL_ORA10G should work with OTL_ORA10G_R2 .

              在編譯OTL的程序時,需要使用到相應的數據庫API,這就要程序在編譯時聯接lib庫文件,不同的數據庫對應的lib文件所在位置各不相同,下面是分別在windowsUnix下的數據庫API所需要的頭文件及lib文件所在的位置列表:

            API

            API header files for Windows

            API libraries for Windows

            OCI7

            In <ORACLE_HOME>\oci\include

             <ORACLE_HOME>\oci\lib\<compiler_specific>\ociw32.lib

            OCI8

            In <ORACLE_HOME>\oci\include

             <ORACLE_HOME>\oci\lib\<compiler_specific>\oci.lib

            OCI8i

            In <ORACLE_HOME>\oci\include

             <ORACLE_HOME>\oci\lib\<compiler_specific>\oci.lib

            OCI9i

            In <ORACLE_HOME>\oci\include

             <ORACLE_HOME>\oci\lib\<compiler_specific>\oci.lib

            OCI10g

            In <ORACLE_HOME>\oci\include

             <ORACLE_HOME>\oci\lib\<compiler_specific>\oci.lib

            ODBC

            Normally, in one of the C++ compiler system directories, no need to include explicitly.

            Normally, in one of the C++ compiler system directories: odbc32.lib

            DB2 CLI

            In <DB2_HOME>\include

            <DB2_HOME>\lib\db2api.lib
            <DB2_HOME>\lib\db2cli.lib

              如果在windows下操縱MS 數據庫,使用MS VC++來編譯OTL程序,就非常簡單了,不用另外去找ODBC32.libVC的編譯器中已經默認link到工程中了,具體請看如何編譯OTLhttp://otl.sourceforge.net/otl3_compile.htm

            posted on 2008-06-13 00:11 楊粼波 閱讀(3010) 評論(0)  編輯 收藏 引用

            四虎国产精品成人免费久久| 久久国产乱子伦精品免费强| 久久人人爽人人人人片av| 亚洲国产成人精品久久久国产成人一区二区三区综 | 亚洲美日韩Av中文字幕无码久久久妻妇| 久久久国产一区二区三区| 国产精品亚洲综合久久 | 久久er国产精品免费观看8| 人妻精品久久久久中文字幕| 看久久久久久a级毛片| 国内精品久久久久久久涩爱| 看久久久久久a级毛片| 久久久久国产视频电影| 久久久久无码精品国产不卡| 久久婷婷午色综合夜啪| 亚洲国产精品久久| 亚洲精品高清国产一线久久| 武侠古典久久婷婷狼人伊人| 亚洲成人精品久久| 粉嫩小泬无遮挡久久久久久| 久久久久亚洲av综合波多野结衣| 国产精品99久久不卡| 好属妞这里只有精品久久| 中文无码久久精品| 久久久无码精品亚洲日韩蜜臀浪潮| 久久国产香蕉一区精品| 精品久久久久久久久久久久久久久 | 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 亚洲AV无码1区2区久久| 久久笫一福利免费导航| 亚洲日本va午夜中文字幕久久| 久久国产成人午夜AV影院| 国产成人精品久久亚洲| 国产综合成人久久大片91| 99久久人人爽亚洲精品美女 | 久久精品成人欧美大片| 久久一区二区免费播放| 色狠狠久久综合网| 精品久久人人爽天天玩人人妻| 久久天天躁狠狠躁夜夜avapp| 伊人久久综合无码成人网|