?? oracle.html
字號:
<html><head><meta name="KEYWORDS" content=" library, C++, Oracle, SQLServer, DB2, Sybase, Informix, InterBase, SQLBase, ODBC,
SQL, server, client, database, programming, development, software,
Win32, Windows, Linux, Unix, Solaris,
Microsoft, Borland, Centura, Gupta, IBM"><meta name="DESCRIPTION" content=
"SQLAPI++ is C++ library for accessing SQL databases (Oracle, SQLServer, Sybase, DB2, InterBase, SQLBase, Informix, ODBC).
It uses native APIs, provides low-level access to database-specific features."><title>SQLAPI++ Library - Server Specific Guide - Oracle</title></head><body bgcolor="#ffffff" BACKGROUND="../images/bg.gif" text="#000000"><!--class="GlbHdr"-->
<table WIDTH=600 height=40
frame=hsides BORDER="2" BORDERCOLOR="#004fcd" align="right" cellpadding="0" cellspacing="2" id="TABLE1">
<tr><!--class="GlbDefault"-->
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../index.html" style="TEXT-DECORATION: none" >
<font color=white size=3 face=sans-serif>
<b>Home</b></font></A></td></TD>
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../HowTo/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>How To</b></font></A></td><!--class="GlbActive"-->
<td width=70 bgcolor=#00bb00 bordercolor=black align=middle>
<A href="../OnLineDoc/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Online Documentation</b></font></A></td><!--class="GlbDefault"-->
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../Support/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Support</b></font></A></td>
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../Download/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Download</b></font></A></td>
<td width=70 bgcolor=#000094 bordercolor=black align=middle>
<A href="../Order/index.html" style="TEXT-DECORATION: none" >
<font color=white size=3
face=sans-serif>
<b>Order</b></font></A></td>
</tr>
</table>
<p> </p>
<p> </p>
<table width="100%">
<tr>
<td valign=top width=165><!--class="LeftMenu"-->
<table frame=void CELLSPACING=5 width=165>
<tr>
<td><p><br></p></td>
</tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="../OnLineDoc/Command.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SACommand</A> </FONT> </td>
</tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="../OnLineDoc/Connection.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SAConnection</A> </FONT> </td>
</tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="../OnLineDoc/Exception.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SAException</font></A> </td>
</tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="../OnLineDoc/Field.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SAField</A> </FONT> </td>
</tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="../OnLineDoc/Param.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SAParam</A> </FONT> </td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="../OnLineDoc/String.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SAString</A> </FONT> </td>
</tr>
<tr>
<td><img align=middle src="../images/green.gif" WIDTH="12" HEIGHT="12">
<A href="../OnLineDoc/DateTime.html" style ="TEXT-DECORATION: none" >
<font color=white size=2 face=sans-serif>
SADateTime</A> </FONT> </td>
</tr>
</table>
</td><!--empty column-->
<td width=20>
<p> </p>
</td><!--Content-->
<td valign=top align=left>
<center>
<H2><A href="index.html">Server Specific Guide</A></H2>
<h1>Oracle</h1>
<P align=left>SQLAPI++ allows to work with a number of SQL database
servers. It provides common mechanisms to access database, and as a
general rule they work for any database server. But each server has
some specific features which developer has to know to use all
server's capability and avoid potential errors.</P>
<P align=left>This page collects all <STRONG>specific</STRONG> information that concerns
working with <STRONG>Oracle</STRONG>
server using SQLAPI++
Library. Full information about using SQLAPI++ see in <A
href="../HowTo/index.html">How To</A>
and <A
href="../OnLineDoc/index.html">Online Documentation</A>.
</P>
<P align=left>Available topics:
</P>
</center>
<P><A
href="Oracle.html#Connecting to a database">Connecting to a
database</A></P>
<P><A
href="Oracle.html#Transaction isolation levels">Transaction
isolation levels</A></P>
<P><A
href="Oracle.html#Working with Long or Lob(CLob, BLob) data">Working with
Long or Lob(CLob, BLob) data</A></P>
<P><A
href="Oracle.html#Returning output parameters">Returning output parameters</A></P>
<P><A
href="Oracle.html#Cancelling queries">Cancelling queries</A></P>
<P><A
href="Oracle.html#Connection and command options">Connection and
command options</A></P>
<P><A
href="Oracle.html#Getting native Oracle API"> Getting native Oracle API</A></P>
<P><A
href="Oracle.html#Getting native Oracle connection related handles"> Getting native Oracle connection related
handles</A></P>
<P><A
href="Oracle.html#Getting native Oracle command related handles"> Getting native Oracle command related
handles</A></P>
<P><A href="Oracle.html#Error handling">Error
handling</A></P>
<P><A href="Oracle.html#Special header files - Compile time">Special header files - Compile time</A></P>
<P> </P>
<H3><A
name="Connecting to a database">Connecting to a database</A> </H3>
<p>To connect to a database you should create a
connection object and then connect it. A connection object is
represented by <A href="../OnLineDoc/Connection.html" >SAConnection</A>
class. After the connection is created you need to connect it to
<STRONG>Oracle</STRONG>
server using <A href="../OnLineDoc/Connection_Connect.html" >SAConnection::Connect</A>
method</p>
<p><font face=Arial><b
>void Connect( const SAString
&</b>sDBString<b>, const SAString
&</b>sUserID<b>, const SAString
&</b>sPassword<b>, SAClient_t</b>
eSAClient<b> = SA_Client_NotSpecified );</b><b>
<BR></b></font></p>
<p>with the following parameters:</p>
<P><EM>sDBString.</EM> The database name as it is
specified in TNSNAMES.ORA file.<BR><EM>sUserID.</EM> A string containing a user name
to use when establishing the connection.<BR><EM>sPassword.</EM> A string containing a
password to use when establishing the connection.<BR><EM>eSAClient.</EM> Optional. One of the
following values from <STRONG>SAClient_t</STRONG>
enum:</P>
<UL>
<LI><STRONG>SA_Oracle_Client</STRONG>
Oracle client.
<LI><STRONG>SA_Client_NotSpecified</STRONG>
Used by default if <EM>eSAClient</EM>parameter is
omitted. You can use this default value only if you have
call <A
href="../OnLineDoc/Connection_setClient.html">SAConnection::setClient</A>
method with <STRONG>SA_Oracle_Client</STRONG> constant before.</LI>
</UL>
<P>The SQLAPI++ Library requires OCI version 7.3
or higher. The Library tries to connect to Oracle using OCI8 first.
If it fails it tries to connect using OCI7. If you want to use
directly OCI7 or OCI8 API you should set "<STRONG>UseAPI</STRONG>" <A href="Oracle.html#Connection and command options" >connection
option</A> before specifying <STRONG>Oracle</STRONG>
client or connecting to database.</P>
<P>For more details see <A
href="../HowTo/connect.html">How To - Connecting to databases</A>, <A
href="../OnLineDoc/Connection_Usage.html">SAConnection object</A>, <A
href="../OnLineDoc/Connection_Connect.html">SAConnection::Connect</A>, <A
href="../OnLineDoc/Connection_setOption.html">SAConnection::setOption</A></P>
<P> </P>
<H3><A
name="Transaction isolation levels">Transaction isolation
levels</A> </H3>
<P>SQL-92 defines four isolation levels, all of
which are supported by SQLAPI++:</P>
<UL>
<LI>Read uncommitted (the lowest level where
transactions are isolated just enough to ensure that physically
corrupt data is not read)
<LI>Read committed
<LI>Repeatable read
<LI>Serializable (the highest level, where
transactions are completely isolated from one another)</LI></UL>
<P>SQLAPI++ maps different isolation levels on
<STRONG>Oracle</STRONG> server in the following way:</P>
<P> <STRONG
>SA_ReadUncommitted</STRONG> = 'READ
COMMITTED'<BR><STRONG> SA_ReadCommitted</STRONG> =
'READ COMMITTED'<BR><STRONG> SA_RepeatableRead</STRONG> =
'SERIALIZABLE'<BR><STRONG> SA_Serializable</STRONG> =
'SERIALIZABLE'</P>
<P>For more details see <A
href="../OnLineDoc/Connection_setIsolationLevel.html">SAConnection::setIsolationLevel</A>.</P>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -