mod_dbd.html.en revision ba428b299d693a5be94d0c3d8b096e9c1c494646
842ae4bd224140319ae7feec1872b93dfd491143fielding<?xml version="1.0" encoding="ISO-8859-1"?>
842ae4bd224140319ae7feec1872b93dfd491143fielding<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
842ae4bd224140319ae7feec1872b93dfd491143fielding<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
842ae4bd224140319ae7feec1872b93dfd491143fielding XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
842ae4bd224140319ae7feec1872b93dfd491143fielding This file is generated from xml source: DO NOT EDIT
842ae4bd224140319ae7feec1872b93dfd491143fielding XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse -->
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<title>mod_dbd - Apache HTTP Server</title>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<body>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<div id="page-header">
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<p class="apache">Apache HTTP Server Version 2.3</p>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<img alt="" src="/images/feather.gif" /></div>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<div id="path">
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<div id="page-content">
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<div id="preamble"><h1>Apache Module mod_dbd</h1>
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<div class="toplang">
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd<p><span>Available Languages: </span><a href="/en/mod/mod_dbd.html" title="English">&nbsp;en&nbsp;</a></p>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</div>
6ace32dacb8313226eb9019275d0e4fa45a15148rse<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Manages SQL database connections</td></tr>
70535d6421eb979ac79d8f49d31cd94d75dd8b2fjorton<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>dbd_module</td></tr>
a943533fd4d91d114af622731a405407990c4fb1rse<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_dbd.c</td></tr>
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Version 2.1 and later</td></tr></table>
a943533fd4d91d114af622731a405407990c4fb1rse<h3>Summary</h3>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <p><code class="module"><a href="/mod/mod_dbd.html">mod_dbd</a></code> manages SQL database connections using
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <a class="glossarylink" href="/glossary.html#apr" title="see glossary">APR</a>. It provides database connections on request
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse to modules requiring SQL database functions, and takes care of
7933d4a963def02417113b6798d87a36395053b0rse managing databases with optimal efficiency and scalability
7933d4a963def02417113b6798d87a36395053b0rse for both threaded and non-threaded MPMs. For details, see the
71c00f988beb28388702e14cb7fe06f08bd792bbdougm <a href="http://apr.apache.org/">APR</a> website and this overview of the
71c00f988beb28388702e14cb7fe06f08bd792bbdougm <a href="http://people.apache.org/~niq/dbd.html">Apache DBD Framework</a>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm by its original developer.
7933d4a963def02417113b6798d87a36395053b0rse</p>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm</div>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm<div id="quickview"><h3 class="directives">Directives</h3>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm<ul id="toc">
7933d4a963def02417113b6798d87a36395053b0rse<li><img alt="" src="/images/down.gif" /> <a href="#dbdexptime">DBDExptime</a></li>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm<li><img alt="" src="/images/down.gif" /> <a href="#dbdkeep">DBDKeep</a></li>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm<li><img alt="" src="/images/down.gif" /> <a href="#dbdmax">DBDMax</a></li>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm<li><img alt="" src="/images/down.gif" /> <a href="#dbdmin">DBDMin</a></li>
7933d4a963def02417113b6798d87a36395053b0rse<li><img alt="" src="/images/down.gif" /> <a href="#dbdparams">DBDParams</a></li>
7933d4a963def02417113b6798d87a36395053b0rse<li><img alt="" src="/images/down.gif" /> <a href="#dbdpersist">DBDPersist</a></li>
d1bb6e2664788e0437acc18e877562c9a796d7cerse<li><img alt="" src="/images/down.gif" /> <a href="#dbdpreparesql">DBDPrepareSQL</a></li>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<li><img alt="" src="/images/down.gif" /> <a href="#dbdriver">DBDriver</a></li>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</ul>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<h3>Topics</h3>
67139e2d50d1e11558d87f7042f61cb04bb0d1d2jim<ul id="topics">
7933d4a963def02417113b6798d87a36395053b0rse<li><img alt="" src="/images/down.gif" /> <a href="#pooling">Connection Pooling</a></li>
7933d4a963def02417113b6798d87a36395053b0rse<li><img alt="" src="/images/down.gif" /> <a href="#API">Apache DBD API</a></li>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm<li><img alt="" src="/images/down.gif" /> <a href="#prepared">SQL Prepared Statements</a></li>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm</ul><h3>See also</h3>
7933d4a963def02417113b6798d87a36395053b0rse<ul class="seealso">
7933d4a963def02417113b6798d87a36395053b0rse<li><a href="/misc/password_encryptions.html">Password Formats</a></li>
42167da203d969a1402cf7ce09c14586c04af1dfjim</ul></div>
53c239bee62c6d55b5ddfba5d99376d4c8de924ejwoolley<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
7933d4a963def02417113b6798d87a36395053b0rse<div class="section">
7933d4a963def02417113b6798d87a36395053b0rse<h2><a name="pooling" id="pooling">Connection Pooling</a></h2>
7933d4a963def02417113b6798d87a36395053b0rse <p>This module manages database connections, in a manner
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse optimised for the platform. On non-threaded platforms,
7933d4a963def02417113b6798d87a36395053b0rse it provides a persistent connection in the manner of
7933d4a963def02417113b6798d87a36395053b0rse classic LAMP (Linux, Apache, Mysql, Perl/PHP/Python).
7933d4a963def02417113b6798d87a36395053b0rse On threaded platform, it provides an altogether more
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse scalable and efficient <em>connection pool</em>, as
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse described in <a href="http://www.apachetutor.org/dev/reslist">this
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse article at ApacheTutor</a>. Note that <code class="module"><a href="/mod/mod_dbd.html">mod_dbd</a></code>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse supersedes the modules presented in that article.</p>
e726f34f8da08c01ee8bc90904b26196b69c8587wrowe</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
7933d4a963def02417113b6798d87a36395053b0rse<div class="section">
7933d4a963def02417113b6798d87a36395053b0rse<h2><a name="API" id="API">Apache DBD API</a></h2>
7933d4a963def02417113b6798d87a36395053b0rse <p><code class="module"><a href="/mod/mod_dbd.html">mod_dbd</a></code> exports five functions for other modules
7933d4a963def02417113b6798d87a36395053b0rse to use. The API is as follows:</p>
7933d4a963def02417113b6798d87a36395053b0rse
7933d4a963def02417113b6798d87a36395053b0rse <div class="example"><pre><code>typedef struct {
7933d4a963def02417113b6798d87a36395053b0rse apr_dbd_t *handle;
7933d4a963def02417113b6798d87a36395053b0rse apr_dbd_driver_t *driver;
7933d4a963def02417113b6798d87a36395053b0rse apr_hash_t *prepared;
7933d4a963def02417113b6798d87a36395053b0rse} ap_dbd_t;
7933d4a963def02417113b6798d87a36395053b0rse
7933d4a963def02417113b6798d87a36395053b0rse/* Export functions to access the database */
7933d4a963def02417113b6798d87a36395053b0rse
7933d4a963def02417113b6798d87a36395053b0rse/* acquire a connection that MUST be explicitly closed.
176c2742db03fcb7b7d13e6408dd967d87e542e9ben * Returns NULL on error
e0c3fda9f782aee1140d83fbce32672ac299f2a4ben */
3a8856c9ca9e996d3a1fae2c65943c35eed97481rpluemAP_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t*, server_rec*);
7933d4a963def02417113b6798d87a36395053b0rse
7933d4a963def02417113b6798d87a36395053b0rse/* release a connection acquired with ap_dbd_open */
7933d4a963def02417113b6798d87a36395053b0rseAP_DECLARE(void) ap_dbd_close(server_rec*, ap_dbd_t*);
7933d4a963def02417113b6798d87a36395053b0rse
7933d4a963def02417113b6798d87a36395053b0rse/* acquire a connection that will have the lifetime of a request
7933d4a963def02417113b6798d87a36395053b0rse * and MUST NOT be explicitly closed. Return NULL on error.
e335319a08e12eb7daff9afa80e985dc53f652b8jorton * This is the preferred function for most applications.
e335319a08e12eb7daff9afa80e985dc53f652b8jorton */
e335319a08e12eb7daff9afa80e985dc53f652b8jortonAP_DECLARE(ap_dbd_t*) ap_dbd_acquire(request_rec*);
e335319a08e12eb7daff9afa80e985dc53f652b8jorton
e335319a08e12eb7daff9afa80e985dc53f652b8jorton/* acquire a connection that will have the lifetime of a connection
e335319a08e12eb7daff9afa80e985dc53f652b8jorton * and MUST NOT be explicitly closed. Return NULL on error.
7933d4a963def02417113b6798d87a36395053b0rse */
7933d4a963def02417113b6798d87a36395053b0rseAP_DECLARE(ap_dbd_t*) ap_dbd_cacquire(request_rec*);
7933d4a963def02417113b6798d87a36395053b0rse
7933d4a963def02417113b6798d87a36395053b0rse/* Prepare a statement for use by a client module */
7933d4a963def02417113b6798d87a36395053b0rseAP_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*);
7933d4a963def02417113b6798d87a36395053b0rse
7933d4a963def02417113b6798d87a36395053b0rse/* Also export them as optional functions for modules that prefer it */
7933d4a963def02417113b6798d87a36395053b0rseAPR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_open, (apr_pool_t*, server_rec*));
7933d4a963def02417113b6798d87a36395053b0rseAPR_DECLARE_OPTIONAL_FN(void, ap_dbd_close, (server_rec*, ap_dbd_t*));
7933d4a963def02417113b6798d87a36395053b0rseAPR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_acquire, (request_rec*));
7933d4a963def02417113b6798d87a36395053b0rseAPR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_cacquire, (conn_rec*));
7933d4a963def02417113b6798d87a36395053b0rseAPR_DECLARE_OPTIONAL_FN(void, ap_dbd_prepare, (server_rec*, const char*, const char*));
7933d4a963def02417113b6798d87a36395053b0rse</code></pre></div>
7933d4a963def02417113b6798d87a36395053b0rse</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
7933d4a963def02417113b6798d87a36395053b0rse<div class="section">
7933d4a963def02417113b6798d87a36395053b0rse<h2><a name="prepared" id="prepared">SQL Prepared Statements</a></h2>
7933d4a963def02417113b6798d87a36395053b0rse <p><code class="module"><a href="/mod/mod_dbd.html">mod_dbd</a></code> supports SQL prepared statements on behalf
7933d4a963def02417113b6798d87a36395053b0rse of modules that may wish to use them. Each prepared statement
7efe7de73c89c26518714a504359244d03cfbbc5jorton must be assigned a name (label), and they are stored in a hash:
7efe7de73c89c26518714a504359244d03cfbbc5jorton the <code>prepared</code> field of an <code>ap_dbd_t</code>.
f84d3d83a741c21154d42e0ebdec9b9b37efeedcjorton Hash entries are of type <code>apr_dbd_prepared_t</code>
43c3e6a4b559b76b750c245ee95e2782c15b4296jim and can be used in any of the apr_dbd prepared statement
3c36b0324c8486306904c84eb0264affc45ed56cwrowe SQL query or select commands.</p>
3c36b0324c8486306904c84eb0264affc45ed56cwrowe
3c36b0324c8486306904c84eb0264affc45ed56cwrowe <p>It is up to dbd user modules to use the prepared statements
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse and document what statements can be specified in httpd.conf,
e8f95a682820a599fe41b22977010636be5c2717jim or to provide their own directives and use <code>ap_dbd_prepare</code>.</p>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</div>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
cde1010d880fb6230f80c9d697842ea0b1cb79c7dougm<div class="directive-section"><h2><a name="DBDExptime" id="DBDExptime">DBDExptime</a> <a name="dbdexptime" id="dbdexptime">Directive</a></h2>
cde1010d880fb6230f80c9d697842ea0b1cb79c7dougm<table class="directive">
cde1010d880fb6230f80c9d697842ea0b1cb79c7dougm<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Keepalive time for idle connections</td></tr>
7933d4a963def02417113b6798d87a36395053b0rse<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDExptime <var>time-in-seconds</var></code></td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
7933d4a963def02417113b6798d87a36395053b0rse<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</table>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <p>Set the time to keep idle connections alive where the number
8fdc55d1624c714391fe1f93ebafe98ace427f4adougm of connections specified in DBDKeep has been exceeded (threaded
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse platforms only).</p>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse
7933d4a963def02417113b6798d87a36395053b0rse</div>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<div class="directive-section"><h2><a name="DBDKeep" id="DBDKeep">DBDKeep</a> <a name="dbdkeep" id="dbdkeep">Directive</a></h2>
7933d4a963def02417113b6798d87a36395053b0rse<table class="directive">
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum sustained number of connections</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDKeep <var>number</var></code></td></tr>
7933d4a963def02417113b6798d87a36395053b0rse<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
a72de14bfdbf0be9d935be9bdc2df631ca5e032bdougm</table>
a72de14bfdbf0be9d935be9bdc2df631ca5e032bdougm <p>Set the maximum number of connections per process to be
a72de14bfdbf0be9d935be9bdc2df631ca5e032bdougm sustained, other than for handling peak demand (threaded
a72de14bfdbf0be9d935be9bdc2df631ca5e032bdougm platforms only).</p>
a72de14bfdbf0be9d935be9bdc2df631ca5e032bdougm
a72de14bfdbf0be9d935be9bdc2df631ca5e032bdougm</div>
7933d4a963def02417113b6798d87a36395053b0rse<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<div class="directive-section"><h2><a name="DBDMax" id="DBDMax">DBDMax</a> <a name="dbdmax" id="dbdmax">Directive</a></h2>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<table class="directive">
7933d4a963def02417113b6798d87a36395053b0rse<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Maximum number of connections</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDMax <var>number</var></code></td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</table>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse <p>Set the hard maximum number of connections per process
7933d4a963def02417113b6798d87a36395053b0rse (threaded platforms only).</p>
0839d91ee551a0e19ea9577bb00976b97308dfddmartin
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse</div>
7933d4a963def02417113b6798d87a36395053b0rse<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<div class="directive-section"><h2><a name="DBDMin" id="DBDMin">DBDMin</a> <a name="dbdmin" id="dbdmin">Directive</a></h2>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<table class="directive">
7933d4a963def02417113b6798d87a36395053b0rse<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Minimum number of connections</td></tr>
0839d91ee551a0e19ea9577bb00976b97308dfddmartin<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDMin <var>number</var></code></td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
e6e65585927961caf45d4e9e932bb1f4e9e89ca1jerenkrantz<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
e8f95a682820a599fe41b22977010636be5c2717jim</table>
e6e65585927961caf45d4e9e932bb1f4e9e89ca1jerenkrantz <p>Set the minimum number of connections per process (threaded
e8f95a682820a599fe41b22977010636be5c2717jim platforms only).</p>
e6e65585927961caf45d4e9e932bb1f4e9e89ca1jerenkrantz
e8f95a682820a599fe41b22977010636be5c2717jim</div>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<div class="directive-section"><h2><a name="DBDParams" id="DBDParams">DBDParams</a> <a name="dbdparams" id="dbdparams">Directive</a></h2>
cc003103e52ff9d5fe9bed567ef9438613ab4fbfrse<table class="directive">
7933d4a963def02417113b6798d87a36395053b0rse<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Parameters for database connection</td></tr>
7933d4a963def02417113b6798d87a36395053b0rse<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDParams
7933d4a963def02417113b6798d87a36395053b0rse<var>param1</var>=<var>value1</var>[,<var>param2</var>=<var>value2</var>]</code></td></tr>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe</table>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <p>As required by the underlying driver. Typically this will be
239dd0cf663713025d4451ddd465685021007d82wrowe used to pass whatever cannot be defaulted amongst username,
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe password, database name, hostname and port number for connection.</p>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <p>Connection string parameters for current drivers include:</p>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dl>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dt>FreeTDS (for MSSQL and SyBase)</dt>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dd>username, password, appname, dbname, host, charset, lang, server</dd>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dt>MySQL</dt>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dd>host, port, user, pass, dbname, sock</dd>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dt>Oracle</dt>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dd>user, pass, dbname, server</dd>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dt>PostgreSQL</dt>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dd>The connection string is passed straight through to <code>PQconnectdb</code></dd>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dt>SQLite2</dt>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dd>The connection string is split on a colon, and <code>part1:part2</code> is used as <code>sqlite_open(part1, atoi(part2), NULL)</code></dd>
239dd0cf663713025d4451ddd465685021007d82wrowe <dt>SQLite3</dt>
239dd0cf663713025d4451ddd465685021007d82wrowe <dd>The connection string is passed straight through to <code>sqlite3_open</code></dd>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <dt>ODBC</dt>
239dd0cf663713025d4451ddd465685021007d82wrowe <dd>Please see <a href="http://code.google.com/p/odbc-dbd/">the
239dd0cf663713025d4451ddd465685021007d82wrowe author's project pages</a> for this third-party driver.</dd>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe </dl>
56bd16e394f49423a22aa82643eb27f26db2c748jorton
56bd16e394f49423a22aa82643eb27f26db2c748jorton</div>
56bd16e394f49423a22aa82643eb27f26db2c748jorton<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
56bd16e394f49423a22aa82643eb27f26db2c748jorton<div class="directive-section"><h2><a name="DBDPersist" id="DBDPersist">DBDPersist</a> <a name="dbdpersist" id="dbdpersist">Directive</a></h2>
56bd16e394f49423a22aa82643eb27f26db2c748jorton<table class="directive">
e8f95a682820a599fe41b22977010636be5c2717jim<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Whether to use persistent connections</td></tr>
e8f95a682820a599fe41b22977010636be5c2717jim<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDPersist On|Off</code></td></tr>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
239dd0cf663713025d4451ddd465685021007d82wrowe</table>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe <p>If set to Off, persistent and pooled connections are disabled.
d1bb6e2664788e0437acc18e877562c9a796d7cerse A new database connection is opened when requested by a client,
71c00f988beb28388702e14cb7fe06f08bd792bbdougm and closed immediately on release. This option is for debugging
71c00f988beb28388702e14cb7fe06f08bd792bbdougm and low-usage servers.</p>
71c00f988beb28388702e14cb7fe06f08bd792bbdougm
7933d4a963def02417113b6798d87a36395053b0rse <p>The default is to enable a pool of persistent connections
e8f95a682820a599fe41b22977010636be5c2717jim (or a single LAMP-style persistent connection in the case of a
b5451913a64155af2eab4f12ecbaf16e15acafc3wrowe non-threaded server), and should almost always be used in operation.</p>
b5451913a64155af2eab4f12ecbaf16e15acafc3wrowe
8aced0b621ea45e8621c7073b0bfbe5ea91c2329wrowe <p>Prior to version 2.2.2, this directive accepted only the values
239dd0cf663713025d4451ddd465685021007d82wrowe <code>0</code> and <code>1</code> instead of <code>Off</code> and
b5451913a64155af2eab4f12ecbaf16e15acafc3wrowe <code>On</code>, respectively.</p>
239dd0cf663713025d4451ddd465685021007d82wrowe
93350a0dfa22a2c523cdcbad3357327013ecc145martin</div>
2c038bf2465bf2150c396f4e67f68ebc5bb9e6e9wrowe<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
b5451913a64155af2eab4f12ecbaf16e15acafc3wrowe<div class="directive-section"><h2><a name="DBDPrepareSQL" id="DBDPrepareSQL">DBDPrepareSQL</a> <a name="dbdpreparesql" id="dbdpreparesql">Directive</a></h2>
b5451913a64155af2eab4f12ecbaf16e15acafc3wrowe<table class="directive">
b5451913a64155af2eab4f12ecbaf16e15acafc3wrowe<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define an SQL prepared statement</td></tr>
239dd0cf663713025d4451ddd465685021007d82wrowe<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDPrepareSQL <var>"SQL statement"</var> <var>label</var></code></td></tr>
8a5120efd60acf0323371cb30cba489723b03819jorton<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
e13735ceb2025ea8ed0c530093e13fe57b62f1efwrowe<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
b5451913a64155af2eab4f12ecbaf16e15acafc3wrowe<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
e13735ceb2025ea8ed0c530093e13fe57b62f1efwrowe</table>
e13735ceb2025ea8ed0c530093e13fe57b62f1efwrowe <p>For modules such as authentication that use repeatedly use a
8aced0b621ea45e8621c7073b0bfbe5ea91c2329wrowe single SQL statement, optimum performance is achieved by preparing
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe the statement at startup rather than every time it is used.
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe This directive prepares an SQL statement and assigns it a label.</p>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe</div>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
2b7078b0c4fd5b6054f6f2d4f626177844f5c6f7wrowe<div class="directive-section"><h2><a name="DBDriver" id="DBDriver">DBDriver</a> <a name="dbdriver" id="dbdriver">Directive</a></h2>
af5dd1c93d2185f7e37f8783c593b64fd35ea8a6wrowe<table class="directive">
af5dd1c93d2185f7e37f8783c593b64fd35ea8a6wrowe<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Specify an SQL driver</td></tr>
8dc154408549195c828b823e9dc7396f107f2512jorton<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DBDriver <var>name</var></code></td></tr>
8dc154408549195c828b823e9dc7396f107f2512jorton<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
b79b480213d7452db127eec054e52eb2b4fa6153wrowe<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
417f504d4d11631c0d062be85347f82a26c88677aaron<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dbd</td></tr>
417f504d4d11631c0d062be85347f82a26c88677aaron</table>
7933d4a963def02417113b6798d87a36395053b0rse <p>Selects an apr_dbd driver by name. The driver must be installed
7933d4a963def02417113b6798d87a36395053b0rse on your system (on most systems, it will be a shared object or dll).
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm For example, <code>DBDriver mysql</code> will select the MySQL
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm driver in apr_dbd_mysql.so.</p>
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm</div>
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm</div>
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm<div class="bottomlang">
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm<p><span>Available Languages: </span><a href="/en/mod/mod_dbd.html" title="English">&nbsp;en&nbsp;</a></p>
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm</div><div id="footer">
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm<p class="apache">Copyright 2008 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
9cb81d96f6b556cec1aa456191f43f7932aabaaedougm</body></html>