⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 otl3_compile.htm

📁 ISO_C++:C++_OTL开发文档
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
  <meta name="Author" content="Sergei Kuchin">
  <meta name="GENERATOR"
 content="Mozilla/4.77 [en] (Win95; U) [Netscape]">
  <meta name="KeyWords"
 content="OTL, Oracle, ODBC, DB2, CLI, database API, C++, Template Library">
  <title>OTL 4.0, How to compile OTL</title>
</head>
<body>
<br>
<br>
<center>
<h1>OTL 4.0, How to compile OTL</h1>
</center>
<h1>
<a name="otl_compile"></a>How to compile OTL</h1>
OTL 4.0 is an integrated library which contains a template
stream framework and OTL-adapters for the OCI7, OCI8, OCI8i, OCI9i,
OCI10g,
ODBC 2.5, ODBC 3.x, DB2 CLI, and Informix CLI. The following macro
definitions (#define's) need to
be used in order to
compile OTL for each type of the underlying database API from the list
above:<br>
<br>
<table style="text-align: left; width: 100%;" border="1" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;">#define
Name</span></td>
      <td style="vertical-align: top;"><span style="font-weight: bold;">Explanation<br>
      </span></td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><a name="OTL_DB2_CLI"></a><b>OTL_DB2_CLI</b></td>
      <td style="vertical-align: top;"> for <a
 href="http://www-4.ibm.com/software/data/db2/">DB2</a>
Call Level Interface (CLI)</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_ODBC_ENTERPRISEDB"></a>OTL_ODBC_<br>
ENTERPRISEDB</span><br>
      </td>
      <td style="vertical-align: top;">for <a
 href="http://www.enterprisedb.com">Enterprise DB</a> ODBC provider.
Enterprise DB is a variant of PostreSQL that was made compatible with
Oracle (up to some extent) and commecially available.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_INFORMIX_CLI"></a>OTL_INFORMIX_CLI</span><br>
      </td>
      <td style="vertical-align: top;">for Informix Call Level
Interface for Unix (when&nbsp; <a href="#OTL_ODBC_UNIX">OTL_ODBC_UNIX</a>
is enabled).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><a name="OTL_IODBC_BSD"></a><b>OTL_IODBC_BSD</b></td>
      <td style="vertical-align: top;">for ODBC on BSD Unix, when iODBC
package is used<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><b><a name="OTL_ODBC"></a>OTL_ODBC</b></td>
      <td style="vertical-align: top;">for ODBC</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_ODBC_MSSQL_2005"></a>OTL_ODBC_MSSQL_2005</span><br>
      </td>
      <td style="vertical-align: top;">Microsoft SQL Server 2005
requires special treatment when VARCHAR(MAX), VARBINARY(MAX), and
NVARCHAR(MAX) are used. MS SQL 2005's Native SQL Client (SNAC) handles
the new XXX(MAX) data types in a different way, compared with TEXT,
NTEXT, and IMAGE data types. If the XXX(MAX) types are not used,
#define OTL_ODBC can be used. Otherwise, this new #define
OTL_ODBC_MSSQL_2005 should be used.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><a name="OTL_ODBC_MSSQL_2008"></a><span
 style="font-weight: bold;">OTL_ODBC_<br>
MSSQL_2008</span><br>
      </td>
      <td style="vertical-align: top;">MS SQL Server 2008 has new
features like datetime2, date, time, filestream based VARBINARY(MAX),
etc. This #define enables OTL support for most of the new features.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><a name="OTL_ODBC_MULTI_MODE"></a><span
 style="font-weight: bold;">OTL_ODBC_<br>
MULTI_MODE</span><br>
      </td>
      <td style="vertical-align: top;">This #define should be used when
there is a need to connect via ODBC to more than one database type from
the same time. For more detail see otl_connect::<a
 href="otl3_connect_class.htm#set_connection_mode">set_connection_mode</a>(),
and OTL example <a href="otl4_ex675.htm">675</a>.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><small><small><a
 name="OTL_ODBC_MYSQL"></a></small></small><b>OTL_ODBC_MYSQL</b></td>
      <td style="vertical-align: top;">for <i><a
 href="http://www.mysql.com/downloads/api-myodbc.html">MyODBC</a>/<a
 href="http://www.mysql.com/">MySQL</a></i>.
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. This #define should only used with the MyODBC
2.5, which is very old at this point in time. See MySQL based OTL code
examples for more detail.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_ODBC_POSTGRESQL"></a>OTL_ODBC_<br>
POSTGRESQL</span><br>
      </td>
      <td style="vertical-align: top;">PostgreSQL ODBC can be used with
the standard #define <a href="#OTL_ODBC">OTL_ODBC</a>. However,
PostgreSQL has at least two ODBC drivers,&nbsp; and some of them should
be used with #define OTL_ODBC_POSTGRESQL. The following list specifies
the differences between #define OTL_ODBC and #define
OTL_ODBC_POSTGRESQL in more detail:<br>
      <ul>
        <li>Linux<br>
        </li>
        <ul>
          <li>psqlodbc.so,&nbsp; psqlodbcw.so should be used with
#define OTL_ODBC_POSTGRESQL</li>
          <li>libodbcpsql.so should be used with #define OTL_ODBC<br>
          </li>
        </ul>
        <li>Solaris<br>
        </li>
        <ul>
          <li>libodbcpsql.so should be used with #define
OTL_ODBC_POSTGRESQL<br>
          </li>
        </ul>
        <li>Windows</li>
        <ul>
          <li>pgsqlodbc30a.dll, pgsqlodbc35w.dll should be used with
#define OTL_ODBC_POSTGRESQL<br>
          </li>
        </ul>
      </ul>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><a name="OTL_ODBC_TIMESTEN_UNIX"></a><span
 style="font-weight: bold;">OTL_ODBC_<br>
TIMESTEN_UNIX</span><br>
      </td>
      <td style="vertical-align: top;">for TimesTen in Unix/Linux.
TimesTen supports ODBC. Unlike many other database systems, where ODBC
API support may be much slower than the proprietary interface, ODBC is
the <span style="font-style: italic;">native </span>TimesTen
interface that operates directly with the database engine. TimesTen
ODBC driver has the following extensions that are available through OTL:<br>
      <ul>
        <li>the <a href="otl3_bind_variables.htm#NAMED_BV_NOTATION">named
notation</a> for bind variables / placeholders</li>
        <li>TT_PRFEFETCH_COUNT ([1..128] range)<br>
        </li>
      </ul>
      <br>
See "how to <a href="#TIMESTEN_ODBC_UNIX_COMPILE">compile</a> TimesTen
in Linux/Unix" for more detail. </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_ODBC_TIMESTEN_WIN"></a>OTL_ODBC_</span><br
 style="font-weight: bold;">
      <span style="font-weight: bold;">TIMESTEN_WIN</span><br>
      </td>
      <td style="vertical-align: top;">for TimesTen in Windows.
TimesTen supports ODBC. Unlike many other database systems, where ODBC
API support may be much slower than the proprietary interface, ODBC is
the <span style="font-style: italic;">native </span>TimesTen
interface that operates directly with the database engine. ODBC driver
has the following extensions that are available through OTL:<br>
      <ul>
        <li>the <a href="otl3_bind_variables.htm#NAMED_BV_NOTATION">named
notation</a> for bind variables / placeholders</li>
        <li>TT_PRFEFETCH_COUNT ([1..128] range)<br>
        </li>
      </ul>
See how to <a href="#TIMESTEN_ODBC_WIN_COMPILE">compile</a> TimesTen
in Windows for more detail. </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><small><a name="OTL_ODBC_UNIX"></a></small><b>OTL_ODBC_UNIX</b></td>
      <td style="vertical-align: top;">for ODBC
bridges
in Unix</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><b><a name="OTL_ODBC_zOS"></a>OTL_ODBC_zOS</b></td>
      <td style="vertical-align: top;">for ODBC on IBM zOS.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><small><a name="INTERBASE"></a></small><b>OTL_ODBC_XTG_IBASE6</b><small><b>
      </b></small></td>
      <td style="vertical-align: top;">for <a
 href="http://www.borland.com/devsupport/interbase/opensource/">Interbase</a>
6.x via <a href="http://www.xtgsystems.com/">XTG Systems'</a>&nbsp; <a
 href="http://www.xtgsystems.com/ib6odbc.php3">ODBC
driver</a>. 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.</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><b><a name="OTL_ORA7"></a>OTL_ORA7</b></td>
      <td style="vertical-align: top;">for OCI7</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><b><a name="OTL_ORA8"></a>OTL_ORA8</b></td>
      <td style="vertical-align: top;">for OCI8</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><b><a name="OTL_ORA8I"></a>OTL_ORA8I</b></td>
      <td style="vertical-align: top;">for OCI8i</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><a name="OTLORA9I"></a><b>OTL_ORA9I<a
 name="OTL_ORA9I"></a></b></td>
      <td style="vertical-align: top;">for OCI9i. All
code
that
compiles and works under #define OTL_ORA7, OTL_ORA8, and OTL_ORA8I,
should
work when OTL_ORA9I is used</td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a
 name="OTL_ORA10G"></a>OTL_ORA10G</span><br>
      </td>
      <td style="vertical-align: top;">for
OCI10g. All code that compiles and works&nbsp; under #define OTL_ORA7,
OTL_ORA8, OTL_ORA8I, OTL_ORA9I, should work with OTL_ORA10G.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><span style="font-weight: bold;"><a

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -