78 lines
4.5 KiB
HTML
78 lines
4.5 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="concept" />
|
||
|
<meta name="DC.Title" content="ODBC APIs: General concepts" />
|
||
|
<meta name="abstract" content="The following general concepts apply to ODBC APIs:" />
|
||
|
<meta name="description" content="The following general concepts apply to ODBC APIs:" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzaikodbcapiinfo.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="odbcenvconnstate" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>ODBC APIs: General concepts</title>
|
||
|
</head>
|
||
|
<body id="odbcenvconnstate"><a name="odbcenvconnstate"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">ODBC APIs: General concepts</h1>
|
||
|
<div><p>The following general concepts apply to ODBC APIs: </p>
|
||
|
<dl><dt class="dlterm">Environments:</dt>
|
||
|
<dd>The environment in which Windows<sup>®</sup> makes available some memory
|
||
|
for ODBC to monitor its run-time information. </dd>
|
||
|
<dt class="dlterm">Connections:</dt>
|
||
|
<dd>Within the environment there can be multiple connections, each to a data
|
||
|
source. The connections may be to different physical servers, to the same
|
||
|
server, or any combination of both.</dd>
|
||
|
<dt class="dlterm">Statements:</dt>
|
||
|
<dd>Multiple statements can be run within each connection.</dd>
|
||
|
<dt class="dlterm">Handles:</dt>
|
||
|
<dd>Handles are identifiers for storage areas that are allocated by the Driver
|
||
|
Manager or individual drivers. The three types of handles are: <dl><dt class="dlterm">Environment handle:</dt>
|
||
|
<dd>Global information, that includes other handles. One handle is allowed
|
||
|
per application.</dd>
|
||
|
<dt class="dlterm">Connection handle:</dt>
|
||
|
<dd>Information about connection to a data source. Multiple connection handles
|
||
|
are allowed per environment.</dd>
|
||
|
<dt class="dlterm">Statement handle:</dt>
|
||
|
<dd>Information about a particular SQL statement. Multiple statement handles
|
||
|
are allowed per connection. Statement handles can be reused for other SQL
|
||
|
statements and long as the statement state is valid.</dd>
|
||
|
<dt class="dlterm">Descriptor handle:</dt>
|
||
|
<dd>Information about explicit descriptors that are associated with the connection
|
||
|
handle. The application creates these, and asks the driver to use them instead
|
||
|
of the implicit descriptors associated with a statement handle.</dd>
|
||
|
</dl>
|
||
|
<p>Essentially, a <strong>handle</strong> can be considered as an identifier
|
||
|
for a resource that is recognized by ODBC (an environment, connection or statement).
|
||
|
ODBC provides an identifier (the handle) for this resource that you can use
|
||
|
in your program. Exactly what ODBC stores in the handle (which is held as
|
||
|
a long integer) is not relevant. Be careful not to change the value, and to
|
||
|
assign unique names to the variables that hold the various handles.</p>
|
||
|
<p>Some
|
||
|
APIs set the handle (for example, <span class="apiname">SQLAllocEnv</span> or <span class="apiname">SQLAllocHandle</span> with
|
||
|
SQL_HANDLE_ENV handle type), and you must pass in a reference, or pointer
|
||
|
to the variable. Some APIs refer to a handle that previously was set (for
|
||
|
example, <strong>SQLExecute</strong>), and you must pass in the variable by value.</p>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaikodbcapiinfo.htm" title="Identify the files required to build an ODBC application.">Files required to build an ODBC application</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|