📄 connection_nativeapi.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 - Online Documentation - SAConnection::NativeAPI</title></head><body bgcolor="#ffffff" BACKGROUND="../images/bg.gif" text="#000000"><!--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="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"><!--LeftMenu-->
<table frame="void" CELLSPACING="5" width="165">
<tr><td><p> </p></td>
</tr>
<tr>
<td><img align="middle" src="../images/green.gif" WIDTH="12" HEIGHT="12"><A href="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/red.gif" WIDTH="12" HEIGHT="12"><A href="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="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="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="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="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="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" style="WIDTH: 4000px" width=4000>
<table width="100%" cellspacing="2" cellpadding="2">
<tr>
<td align="left"><A href="Connection_Usage.html" style="TEXT-DECORATION: none"><h3>Usage</h3></A>
</td>
<td align="left"><A href="Connection.html" style="TEXT-DECORATION: none"><h3>Class Members</h3></A>
</td>
<td align="left"><A href="Connection_Examples.html#NativeAPI" style="TEXT-DECORATION: none"><h3>Examples</h3></A>
</td>
</tr>
<tr>
<td colspan="3"><h1>SAConnection::NativeAPI</h1></td>
</tr>
</table>
<p><font face="Arial"><b> saAPI *NativeAPI() const;</b><b> </b></font></p>
<p>
Returns a
set
of functions of native DBMS client
API.
</p>
<h3>Return value</h3>
<P> A pointer to a base <STRONG>class saAPI</STRONG> from which a family of DBMS
implementation-specific classes are derived.</P>
<h3>Remarks</h3>
<p>
Use <STRONG>NativeAPI</STRONG> method if you want to
call client specific API functions which are not directly supported by
the Library. <STRONG>NativeAPI</STRONG> method returns a
pointer to the set of native API functions available for an DBMS
client you currently use. To use the database API directly you have
to downcast this <STRONG>saAPI</STRONG> pointer to
the appropriate type and use its implementation-specific
members.
</p>
<p>
See <STRONG>DBMS specific notes</STRONG>
section to know what type cast you have to
make and what additional header file you have to include to work
with specific DBMS client API. Note that for some DBMS using
appropriate type casting depends on an API version (that generally
mean that you have to explicitly check client version before
casting, see <A
href="Connection_ClientVersion.html">ClientVersion</A>
method).
</p>
<p>
To
get more information about
DBMS API functions see this DBMS specific
documentation.
</p>
<p><A name=idx45><!></A>Please be aware of the
complications associated with making direct API calls, as the
internal logic of the SQLAPI++ Library
is not used. Besides,
making direct API calls reduces an application's
portability.
</p>
<h3>DBMS specific notes</h3>
<table width="100%" border=1 cellpadding=5>
<tr bgColor="#000094">
<td width=30>
<p><STRONG><FONT color=white face="">DBMS
client</FONT> </STRONG></p>
</td>
<td style="WIDTH: 300px" width=300>
<P><STRONG><FONT color=white face="">Type
casting</FONT> </STRONG></P>
</td>
<td>
<P><STRONG><FONT color=white face="">Additional
<BR> include
file</FONT> </STRONG></P>
</td>
</tr>
<tr>
<td>
<p><STRONG><A
href="../ServerSpecific/Oracle.html" title="Oracle server specific information">Oracle 8</A>
(OCI8)</STRONG></p>
</td>
<td>
<P>Cast the result to <STRONG>class ora8API</STRONG>:</P>
<P><FONT face=System>saAPI *pResult
= con.NativeAPI();<BR>ora8API *p_ora8API = (ora8API
*)pResult;</FONT></P>
</td>
<td>
<P><STRONG>#include <oraAPI.h></STRONG></P>
</td>
</tr>
<tr>
<td>
<p><STRONG><A
href="../ServerSpecific/Oracle.html" title="Oracle server specific information">Oracle 7</A>
(OCI7)</STRONG></p>
</td>
<td>
<P>Cast the result to <STRONG>class ora7API</STRONG>:</P>
<P><FONT face=System>saAPI *pResult
= con.NativeAPI();<BR>ora7API *p_ora7API = (ora7API
*)pResult;</FONT></P>
</td>
<td>
<P><STRONG>#include <ora7API.h></STRONG></P>
</td>
</tr>
<tr>
<td>
<p><STRONG><A
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -