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

📄 146.html

📁 Python Ebook Python&XML
💻 HTML
字号:

<!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="Robots" content="INDEX,NOFOLLOW">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<TITLE>Safari | Python Developer's Handbook -&gt; Python DB API</TITLE>
<LINK REL="stylesheet" HREF="oreillyi/oreillyN.css">
</HEAD>
<BODY bgcolor="white" text="black" link="#990000" vlink="#990000" alink="#990000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" cellpadding=5 cellspacing=0 border=0 class="navtopbg"><tr><td><font size="1"><p class="navtitle"><a href="8.html" class="navtitle">Web Development</a> &gt; <a href="0672319942.html" class="navtitle">Python Developer's Handbook</a> &gt; <a href="137.html" class="navtitle">8. Working with Databases</a> &gt; <span class="nonavtitle">Python DB API</span></p></font></td><td align="right" valign="top" nowrap><font size="1"><a href="main.asp?list" class="safnavoff">See All Titles</a></font></td></tr></table>
<TABLE width=100% bgcolor=white border=0 cellspacing=0 cellpadding=5><TR><TD>
<TABLE border=0 width="100%" cellspacing=0 cellpadding=0><TR><td align=left width="15%" class="headingsubbarbg"><a href="145.html" title="Using SQL"><font size="1">&lt;&nbsp;BACK</font></a></td><td align=center width="70%" class="headingsubbarbg"><font size="1"><a href="popanote.asp?pubui=oreilly&bookname=0672319942&snode=146" target="_blank" title="Make a public or private annnotation">Make Note</a> | <a href="146.html" title="Use a Safari bookmark to remember this section">Bookmark</a></font></td><td align=right width="15%" class="headingsubbarbg"><a href="147.html" title="Summary"><font size="1">CONTINUE&nbsp;&gt;</font></a></td></TR></TABLE>
<a href="5%2F31%2F2002+4%3A39%3A30+PM.html" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><font color=white size=1>152015024128143245168232148039199167010047123209178152124239215162147045098087171051091243</font><a href="read9.asp?bookname=0672319942&snode=146&now=5%2F31%2F2002+4%3A39%3A30+PM" TABINDEX="-1"><img src=images/spacer.gif border=0 width=1 height=1></a><br>
<FONT>
				<h3>
			
			
			
			Python DB API</h3>
				<p>The quest to provide a standard way to interface to database systems drove a group of people to develop Python Database API. The Python DB API is maintained by the Database Special Interest Group (DB-SIG). For more information, check out their Web site at <a TARGet="_blank" hrEF="http://www.python.org/sigs/db-sig/">http://www.python.org/sigs/db-sig/</A>.</P>

				<p>The following list shows all the database modules that currently implement the Python DB API specification proposed by the DB-SIG. This means that after you understand the API, you will be able to handle, in a similar way, all the databases that are manipulated by the following modules:</p>

				<ul>
<LI>
						<P>
							<B>GadFly棤</b>

							A simple relational database system implemented in Python based on the SQL Structured Query Language, including a DB-API compliant interface. Maintained by Aaron Watters.
						</p>

						<p>
							<a target="_blank" href="http://www.chordate.com/gadfly.html">http://www.chordate.com/gadfly.html</a>
						</p>

					</li>
<li>
						<P>
							<b>Informix棤</b>

							Currently maintained by Stephen J. Turner.
						</P>

						<p>
							<a tArget="_blank" Href="http://starship.python.net/crew/sturner/informixdb.html">http://starship.python.net/crew/sturner/informixdb.html</A>
						</P>

					</LI>
<li>
						<p>
							<b>Informix (Kinfxdb)棤</B>

							A completely new Informix module, called <TT Class="monofont">Kinfxdb.</TT> Maintained by Alexander Kuznetsov.
						</P>

						<P>
							<a tarGET="_blank" Href="http://thor.prohosting.com/~alexan/">http://thor.prohosting.com/~alexan/</a>
						</p>

					</li>
<li>
						<p>
							<b>Interbase (Kinterbasdb)棤</b>

							An interface for Interbase 4.0 and 5.0. Maintained by Alexander Kuznetsov.
						</p>

						<p>
							<a targeT="_blank" hrEf="http://thor.prohosting.com/~alexan/Kinterbasdb/">http://thor.prohosting.com/~alexan/Kinterbasdb/</a>
						</p>

					</Li>
<li>
						<p>
							<B>MySQL棤</b>

							A <tt CLASs="monofont">MySQL</tt> module that is thread-safe and aims for compatibility with the 2.0 DB-API. It requires a newer version of MySQL, version 3.22.19 or higher.
						</p>

						<P>
							<A TArget="_blank" HREF="http://dustman.net/andy/python/MySQLdb/">http://dustman.net/andy/python/MySQLdb/</a>
							<a naME="idx1073745114"></A>
							<A name="idx1073745115"></a>
							<a name="idx1073745116"></a>
							<a name="idx1073745117"></a>
						</p>

					</li>
<Li>
						<p>
							<B>mxODBC棤</b>

							The <tt Class="monofont">mxODBC</Tt> package provides a nearly 100% Python DB API compliant interface to databases that are accessible via the ODBC API. Many databases include ODBC libraries, so this might be the only module you need. Maintained by M. A. Lemburg.
						</p>

						<p>
							<A TARget="_blank" hREF="http://starship.python.net/crew/lemburg/mxODBC.html">http://starship.python.net/crew/lemburg/mxODBC.html</A>
						</p>

					</li>
<lI>
						<P>
							<B>ODBC棤</B>

							This module is currently available in the PythonWin distribution. It's public domain code, but unfortunately has no designated support person(s). The best option for support is to ask questions on comp.lang.python newsgroups, where other PythonWin users can answer them.
						</p>

						<p>
							<a tARGEt="_blank" href="http://www.python.org/windows/win32/odbc.html">http://www.python.org/windows/win32/odbc.html</a>
						</p>

					</li>
<li>
						<p>
							<b>DCOracle棤</b>

							An open source interface to Oracle from Digital Creations.
						</p>

						<p>
							<a tarGet="_blank" Href="http://www.zope.org/Products/DCOracle/">http://www.zope.org/Products/DCOracle/</A>
						</p>

					</li>
<lI>
						<p>
							<b>Sybase棤</b>

							Maintained by Peter Godman.
						</P>

						<P>
							<A TargeT="_blank" HREf="http://starship.python.net/crew/pgodman/">http://starship.python.net/crew/pgodman/</a>
						</p>

					</lI>
</UL>
				<P>This is the information available at the time this book was written. For an updated list of modules, check out <a tarGET="_blank" Href="http://www.python.org/topics/database/modules.html">http://www.python.org/topics/database/modules.html</a>.</p>

				
					<h4>DB-API Specification v2.0</h4>
					<p>The following specification is available online at <a target="_blank" href="http://www.python.org/topics/database/DatabaseAPI-2.0.html">http://www.python.org/topics/database/DatabaseAPI-2.0.html</a>.</P>

					<p>Comments and questions about this specification can be directed to the SIG for Database Interfacing with Python at the email address <a Href="mailto:db-sig@python.org">db-sig@python.org</A>.</p>

					<p>For more information on database interfacing with Python and available packages, see the Database Topics Guide at <a tArgeT="_blank" HREf="http://www.python.org">http://www.python.org</a>.</p>

					<p>This document describes the Python Database API Specification 2.0. The previous version 1.0 is still available online at the Python Web site as a reference. Package writers are encouraged to use this version of the specification as the basis for new interfaces.<A NAMe="idx1073745118"></a>
						<a nAME="idx1073745119"></A>
						<a namE="idx1073745120"></A>
						<A Name="idx1073745121"></a>
					</p>

					<p>This API has been defined to encourage similarity between the Python modules that are used to access databases. By doing this, we hope to achieve a consistency leading to more easily understood modules, code that is generally more portable across databases, and a broader reach of database connectivity from Python.</p>

					<p>The interface specification consists of several sections:</p>

					<ul>
<li>
							<p>Module Interface</p>

						</li>
<li>
							<p>Connection Objects</P>

						</li>
<Li>
							<p>Cursor Objects</p>

						</Li>
<li>
							<p>Type Objects and Constructors</P>

						</li>
<lI>
							<P>Implementation Hints</P>

						</Li>
<li>
							<p>Major Changes from 1.0 to 2.0</P>

						</LI>
</Ul>
					
						<h5>
					
					
					Module Interface</h5>
						<p>Access to the database is made available through connection objects. The module must provide the following constructor for these:</P>

						<BLOckquOTE>
<P>
								<p>
									<a name="idx1073745122"></a>
									<a name="idx1073745123"></a>
									<tt class="monofont">connect(parameters

⌨️ 快捷键说明

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