summaryrefslogtreecommitdiff
path: root/docs/installation/build_unix_sql.html
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-02-17 17:25:57 +0000
committer <>2015-03-17 16:26:24 +0000
commit780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch)
tree598f8b9fa431b228d29897e798de4ac0c1d3d970 /docs/installation/build_unix_sql.html
parent7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff)
downloadberkeleydb-master.tar.gz
Imported from /home/lorry/working-area/delta_berkeleydb/db-6.1.23.tar.gz.HEADdb-6.1.23master
Diffstat (limited to 'docs/installation/build_unix_sql.html')
-rw-r--r--docs/installation/build_unix_sql.html722
1 files changed, 413 insertions, 309 deletions
diff --git a/docs/installation/build_unix_sql.html b/docs/installation/build_unix_sql.html
index e48f966f..f0dae3bd 100644
--- a/docs/installation/build_unix_sql.html
+++ b/docs/installation/build_unix_sql.html
@@ -14,17 +14,17 @@
<body>
<div xmlns="" class="navheader">
<div class="libver">
- <p>Library Version 11.2.5.3</p>
+ <p>Library Version 12.1.6.1</p>
</div>
<table width="100%" summary="Navigation header">
<tr>
- <th colspan="3" align="center">Configuring the SQL Interface</th>
+ <th colspan="3" align="center">Configuring the SQL
+ Interface</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="build_unix_conf.html">Prev</a> </td>
- <th width="60%" align="center">Chapter 7. 
- Building Berkeley DB for UNIX/POSIX
- </th>
+ <th width="60%" align="center">Chapter 7.  Building Berkeley DB for UNIX/POSIX
+ </th>
<td width="20%" align="right"> <a accesskey="n" href="build_unix_small.html">Next</a></td>
</tr>
</table>
@@ -34,7 +34,8 @@
<div class="titlepage">
<div>
<div>
- <h2 class="title" style="clear: both"><a id="build_unix_sql"></a>Configuring the SQL Interface</h2>
+ <h2 class="title" style="clear: both"><a id="build_unix_sql"></a>Configuring the SQL
+ Interface</h2>
</div>
</div>
</div>
@@ -47,7 +48,7 @@
</dt>
<dt>
<span class="sect2">
- <a href="build_unix_sql.html#idp249752">Enabling Extensions</a>
+ <a href="build_unix_sql.html#idp698856">Enabling Extensions</a>
</span>
</dt>
<dt>
@@ -57,12 +58,12 @@
</dt>
<dt>
<span class="sect2">
- <a href="build_unix_sql.html#idp327120">Using the JDBC Driver</a>
+ <a href="build_unix_sql.html#idp704816">Using the JDBC Driver</a>
</span>
</dt>
<dt>
<span class="sect2">
- <a href="build_unix_sql.html#idp349152">Building the ODBC Driver</a>
+ <a href="build_unix_sql.html#idp736952">Building the ODBC Driver</a>
</span>
</dt>
<dt>
@@ -72,142 +73,171 @@
</dt>
</dl>
</div>
- <p>
- There are a set of options you can provide to
- <span class="command"><strong>configure</strong></span> in order to control how the Berkeley DB
- SQL interface is built. These configuration options include:
-</p>
+ <p>
+ There are a set of options you can provide to
+ <span class="command"><strong>configure</strong></span> in order to control how the
+ Berkeley DB SQL interface is built. These configuration
+ options include:
+ </p>
<div class="variablelist">
<dl>
<dt>
<span class="term">--disable-log-checksum</span>
</dt>
- <dd>
- Disables checksums in log records. This provides a boost to
- performance at the risk of log files having undetectable
- corruption that could prevent proper data recovery in case of
- database corruption.
- <p>
- Note that while this option is meant for use with the SQL
- interface, it will also disable checksum for the non-SQL
- interfaces.
- </p></dd>
+ <dd> Disables checksums in log records. This
+ provides a boost to performance at the risk of log
+ files having undetectable corruption that could
+ prevent proper data recovery in case of database
+ corruption.
+ <p>
+ Note that while this option is meant for use
+ with the SQL interface, it will also disable
+ checksum for the non-SQL interfaces.
+ </p></dd>
<dt>
<span class="term">--enable-sql</span>
</dt>
<dd>
- Causes the <span class="command"><strong>dbsql</strong></span> command line interpreter to
- be built. Along with <span class="command"><strong>dbsql</strong></span>, this argument
- also builds the libdb_sqlXX.{so|la} library, a C API library
- that mirrors the SQLite C API.
- </dd>
+ Causes the <span class="command"><strong>dbsql</strong></span> command
+ line interpreter to be built. Along with
+ <span class="command"><strong>dbsql</strong></span>, this argument also
+ builds the libdb_sqlXX.{so|la} library, a C API
+ library that mirrors the SQLite C API.
+ </dd>
<dt>
<span class="term">--enable-sql_compat</span>
</dt>
<dd>
- <p>
- Causes the <span class="command"><strong>sqlite3</strong></span> command line tool to
- be built. This tool is identical to the
- <span class="command"><strong>dbsql</strong></span> command line tool, except that it
- has the same name as the command line tool that comes with
- standard SQLite.
- </p>
- <p>
- In addition, the libsqlite3.{so|la} C API library is built
- if this option is specified. This library is identical to
- the libdb_sqlXX.{so|la} library that is normally built for Berkeley
- DB's sql interface, except that it has the same name as the
- library which is built for standard SQLite.
- </p>
- <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
- <h3 class="title">Warning</h3>
- <p>
- Use this compatibility option with
- <span class="emphasis"><em>extreme</em></span> care. Standard SQLite is
- used by many programs and utilities on many different
- platforms. Some platforms, such as Mac OS X, come with
- standard SQLite built in because default applications for the
- platform use that library.
+ <p>
+ Causes the <span class="command"><strong>sqlite3</strong></span> command
+ line tool to be built. This tool is identical to
+ the <span class="command"><strong>dbsql</strong></span> command line tool,
+ except that it has the same name as the command
+ line tool that comes with standard SQLite.
</p>
- <p>
- <span class="bold"><strong>Use of this option on platforms where standard SQLite
- is in production use can cause unexpected runtime
- errors either for your own application, or for
- applications and utilities commonly found on the
- platform, depending on which library is found first
- in the platform's library search path.</strong></span>
+ <p>
+ In addition, the libsqlite3.{so|la} C API
+ library is built if this option is specified. This
+ library is identical to the libdb_sqlXX.{so|la}
+ library that is normally built for Berkeley DB's
+ sql interface, except that it has the same name as
+ the library which is built for standard SQLite.
</p>
+ <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Warning</h3>
+ <p>
+ Use this compatibility option with
+ <span class="emphasis"><em>extreme</em></span> care.
+ Standard SQLite is used by many programs and
+ utilities on many different platforms. Some
+ platforms, such as Mac OS X, come with
+ standard SQLite built in because default
+ applications for the platform use that
+ library.
+ </p>
<p>
- Use this option <span class="emphasis"><em>only</em></span> if you know
- exactly what you are doing.
- </p>
+ <span class="bold"><strong>Use of this option on
+ platforms where standard SQLite is in
+ production use can cause unexpected
+ runtime errors either for your own
+ application, or for applications and
+ utilities commonly found on the platform,
+ depending on which library is found first
+ in the platform's library search
+ path.</strong></span>
+ </p>
+ <p>
+ Use this option <span class="emphasis"><em>only</em></span>
+ if you know exactly what you are doing.
+ </p>
</div>
<p>
- This option is provided so that there is an easy upgrade
- path for legacy SQLite tools and scripts that want to use
- BDB SQL without rewriting the tool or script. However,
- data contained in standard SQLite databases must be
- manually migrated from the old database to your BDB SQL
- database even if you use this option. See the
- <em class="citetitle">Berkeley DB Getting Started with the SQL APIs</em> guide for information on
- migrating data from standard SQLite to BDB SQL databases.
- </p>
- <p>
- Note that in addition to the renamed command line tool and
- library, this option also causes versions of the command
- line tool and library to be built that use the normal BDB
- SQLite names (<span class="command"><strong>dbsql</strong></span> and libdb_sqlXX.{so|la}).
- </p>
+ This option is provided so that there is an
+ easy upgrade path for legacy SQLite tools and
+ scripts that want to use BDB SQL without rewriting
+ the tool or script. However, data contained in
+ standard SQLite databases must be manually
+ migrated from the old database to your BDB SQL
+ database even if you use this option. See the
+ <em class="citetitle">Berkeley DB Getting Started with the SQL APIs</em> guide for
+ information on migrating data from standard SQLite
+ to BDB SQL databases.
+ </p>
+ <p>
+ Note that in addition to the renamed command
+ line tool and library, this option also causes
+ versions of the command line tool and library to
+ be built that use the normal BDB SQLite names
+ (<span class="command"><strong>dbsql</strong></span> and
+ libdb_sqlXX.{so|la}).
+ </p>
</dd>
<dt>
<span class="term">--enable-test</span>
</dt>
<dd>
- Cause the Berkeley DB SQL interface test suite to be built.
- This argument can also be used with either
- <code class="literal">--enable-sql</code> or
- <code class="literal">--enable-sql_compat</code> to build the SQLite Tcl
- test runner.
- </dd>
+ Cause the Berkeley DB SQL interface test suite
+ to be built. This argument can also be used with
+ either <code class="literal">--enable-sql</code> or
+ <code class="literal">--enable-sql_compat</code> to build
+ the SQLite Tcl test runner.
+ </dd>
<dt>
<span class="term">--enable-jdbc</span>
</dt>
<dd>
+ <p>
+ Causes the JDBC driver to be built. Setting
+ this option implies that
+ <code class="literal">--enable-sql</code> is set, which
+ means that the Berkeley DB SQL API will be built
+ too.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">--with-cryptography</span>
+ </dt>
+ <dd>
<p>
- Causes the JDBC driver to be built. Setting this option
- implies that <code class="literal">--enable-sql</code> is set, which
- means that the Berkeley DB SQL API will be built too.
- </p>
+ Enables encryption support for the Berkeley DB
+ SQL interface. See <a href="../bdb-sql/sql_encryption.html" class="olink">SQL Encryption</a> in the
+ <em class="citetitle">Berkeley DB Getting Started with the SQL APIs</em> guide for
+ usage details.
+ </p>
</dd>
</dl>
</div>
- <p>
- The following configuration options are useful when debugging applications:
-</p>
+ <p>
+ The following configuration options are useful when
+ debugging applications:
+ </p>
<div class="variablelist">
<dl>
<dt>
<span class="term">
- <a class="link" href="build_unix_conf.html#build_unix_conf.--enable-debug">--enable-debug</a>
- </span>
+ <a class="link" href="build_unix_conf.html#build_unix_conf.--enable-debug">--enable-debug</a>
+ </span>
</dt>
<dd>
- Builds the Berkeley DB SQL interface with debug symbols.
- </dd>
+ Builds the Berkeley DB SQL interface with debug
+ symbols.
+ </dd>
<dt>
<span class="term">
- <a class="link" href="build_unix_conf.html#build_unix_conf.--enable-diagnostic">--enable-diagnostic</a>
- </span>
+ <a class="link" href="build_unix_conf.html#build_unix_conf.--enable-diagnostic">--enable-diagnostic</a>
+ </span>
</dt>
<dd>
- Builds the Berkeley DB SQL interface with run-time debugging checks.
- </dd>
+ Builds the Berkeley DB SQL interface with
+ run-time debugging checks.
+ </dd>
</dl>
</div>
- <p>
- Any arguments that you can provide to the standard SQLite configure
- script can also be supplied when configuring Berkeley DB SQL interface.
-</p>
+ <p>
+ Any arguments that you can provide to the standard SQLite
+ configure script can also be supplied when configuring
+ Berkeley DB SQL interface.
+ </p>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
@@ -216,81 +246,133 @@
</div>
</div>
</div>
- <p>There are several configuration options you can specify as an argument to the configure script using the standard environment variable, CFLAGS.</p>
+ <p>
+ There are several configuration options you can specify
+ as an argument to the configure script using the standard
+ environment variable, CFLAGS. For example, to configure
+ with the option BDBSQL_FILE_PER_TABLE, do the
+ following:
+ </p>
+ <pre class="programlisting">$ ../dist/configure --enable-sql CFLAGS="-DBDBSQL_FILE_PER_TABLE=1"</pre>
<div class="variablelist">
<dl>
<dt>
<span class="term">BDBSQL_DEFAULT_PAGE_SIZE</span>
</dt>
- <dd>
-To set the default page size when you create a database, specify the BDBSQL_DEFAULT_PAGE_SIZE flag.
-The value assigned must be a 0, 512, 1024, 2048, 4096, 8192 16384, 32768, or 65536. The default value is 4096.
-If the value is set to zero, Berkeley DB queries the file system to determine the best page size,
-and the value of SQLITE_DEFAULT_PAGE_SIZE is used to calculate the cache size, as the cache size is specified as a number of pages.
-</dd>
+ <dd>
+ To set the default page size when you
+ create a database, specify the
+ BDBSQL_DEFAULT_PAGE_SIZE flag. The value assigned
+ must be a 0, 512, 1024, 2048, 4096, 8192 16384,
+ 32768, or 65536. The default value is 4096. If the
+ value is set to zero, Berkeley DB queries the file
+ system to determine the best page size, and the
+ value of SQLITE_DEFAULT_PAGE_SIZE is used to
+ calculate the cache size, as the cache size is
+ specified as a number of pages.
+ </dd>
<dt>
<span class="term">BDBSQL_FILE_PER_TABLE</span>
</dt>
<dd>
-To generate each table in a separate file, rather than as subdatabases in a single file, specify the BDBSQL_FILE_PER_TABLE flag.
-When this option is enabled, the SQL database name is used as a directory name. This directory contains one file for the metadata and one file each for every table created by the SQL API.
-Note that adding or deleting files from the database directory may corrupt your database.
-To backup the metadata (schema), make a copy of the <code class="literal">metadata</code> and <code class="literal">table00001</code> files from the database directory.
-Make a new copy whenever the schema is changed.
-</dd>
+ To generate each table in a separate file,
+ rather than as subdatabases in a single file,
+ specify the BDBSQL_FILE_PER_TABLE flag. When this
+ option is enabled, the SQL database name is used
+ as a directory name. This directory contains one
+ file for the metadata and one file each for every
+ table created by the SQL API. Note that adding or
+ deleting files from the database directory may
+ corrupt your database. To backup the metadata
+ (schema), make a copy of the
+ <code class="literal">metadata</code> and
+ <code class="literal">table00001</code> files from the
+ database directory. Make a new copy whenever the
+ schema is changed.
+ </dd>
<dt>
<span class="term">BDBSQL_LOG_REGIONMAX</span>
</dt>
<dd>
-To configure the log region size for the underlying storage engine, specify the BDBSQL_LOG_REGIONMAX flag. For more information, see
-<a href="../api_reference/C/envget_lg_regionmax.html" class="olink">DB_ENV-&gt;get_lg_regionmax()</a>.
-
-</dd>
+ To configure the log region size for the
+ underlying storage engine, specify the
+ BDBSQL_LOG_REGIONMAX flag. For more information,
+ see <a href="../api_reference/C/envget_lg_regionmax.html" class="olink">DB_ENV-&gt;get_lg_regionmax()</a>.
+ </dd>
<dt>
- <span class="term">BDBSQL_OMIT_LEAKCHECK
-</span>
+ <span class="term">BDBSQL_OMIT_LEAKCHECK </span>
</dt>
- <dd>For Berkeley DB to use the default system allocation routines rather than the SQLite allocation routines, specify the BDBSQL_OMIT_LEAKCHECK flag.
-</dd>
+ <dd>
+ For Berkeley DB to use the default system
+ allocation routines rather than the SQLite
+ allocation routines, specify the
+ BDBSQL_OMIT_LEAKCHECK flag.
+ </dd>
<dt>
- <span class="term">BDBSQL_OMIT_LOG_REMOVE
-</span>
+ <span class="term">BDBSQL_OMIT_LOG_REMOVE </span>
</dt>
- <dd>Berkeley DB automatically removes log files that are not required any more, that is, files that are older than the most recent checkpoint. To disable this functionality, specify the BDBSQL_OMIT_LOG_REMOVE flag. It is necessary to provide this flag if you are using replication with Berkeley DB SQL.
-</dd>
+ <dd>
+ Berkeley DB automatically removes log files
+ that are not required any more, that is, files
+ that are older than the most recent checkpoint. To
+ disable this functionality, specify the
+ BDBSQL_OMIT_LOG_REMOVE flag. It is necessary to
+ provide this flag if you are using replication
+ with Berkeley DB SQL.
+ </dd>
<dt>
- <span class="term">BDBSQL_OMIT_SHARING
-</span>
+ <span class="term">BDBSQL_OMIT_SHARING </span>
</dt>
- <dd>To create a private environment rather than a shared environment, specify the BDBSQL_OMIT_SHARING flag. That is, the cache and other region files will be created in memory rather than using file backed shared memory. For more information, see the DB_PRIVATE flag of <a href="../api_reference/C/envopen.html" class="olink">DB_ENV-&gt;open()</a>.
-</dd>
+ <dd>
+ To create a private environment rather than
+ a shared environment, specify the
+ BDBSQL_OMIT_SHARING flag. That is, the cache and
+ other region files will be created in memory
+ rather than using file backed shared memory. For
+ more information, see the DB_PRIVATE flag of
+ <a href="../api_reference/C/envopen.html" class="olink">DB_ENV-&gt;open()</a>.
+ </dd>
<dt>
- <span class="term">BDBSQL_SINGLE_THREAD
-</span>
+ <span class="term">BDBSQL_SINGLE_THREAD </span>
</dt>
- <dd>To disable locking and thread safe connections, specify the BDBSQL_SINGLE_THREAD flag. If an application is going to use Berkeley DB from a single thread and a single process, enabling this flag can deliver significant performance advantages.
-</dd>
+ <dd>
+ To disable locking and thread safe
+ connections, specify the BDBSQL_SINGLE_THREAD
+ flag. If an application is going to use Berkeley
+ DB from a single thread and a single process,
+ enabling this flag can deliver significant
+ performance advantages.
+ </dd>
<dt>
- <span class="term">SQLITE_DEFAULT_CACHE_SIZE
-</span>
+ <span class="term">SQLITE_DEFAULT_CACHE_SIZE </span>
</dt>
- <dd>SQLite provides an in-memory cache which you size according to the maximum number of
- database pages that you want to hold in memory at any given time.
- Berkeley DB's in-memory cache feature performs the same function as SQLite.
- To specify the suggested maximum number of pages of disk cache that will be allocated per open database file specify the SQLITE_DEFAULT_CACHE_SIZE flag. Default value is 2000 pages.
- For more information, see the SQLite documentation on <a class="ulink" href="http://www.sqlite.org/pragma.html#pragma_default_cache_size" target="_top">PRAGMA default_cache_size</a>.
-</dd>
+ <dd>
+ SQLite provides an in-memory cache which you
+ size according to the maximum number of database
+ pages that you want to hold in memory at any given
+ time. Berkeley DB's in-memory cache feature
+ performs the same function as SQLite. To specify
+ the suggested maximum number of pages of disk
+ cache that will be allocated per open database
+ file specify the SQLITE_DEFAULT_CACHE_SIZE flag.
+ Default value is 2000 pages. For more information,
+ see the SQLite documentation on <a class="ulink" href="http://www.sqlite.org/pragma.html#pragma_default_cache_size" target="_top">
+ PRAGMA default_cache_size</a>.
+ </dd>
<dt>
- <span class="term">SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT
-</span>
+ <span class="term">SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT </span>
</dt>
<dd>
-For SQLite, this pragma identifies the maximum size that the journal file is allowed
-to be. Berkeley DB does not have a journal file, but it writes and uses log files. A new log file is
-created when the current log file has reached the defined maximum size.
-To define this maximum size for a log file, specify the SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT flag.
-Default value is 10 MB for the Berkeley DB SQL interface.
-</dd>
+ For SQLite, this pragma identifies the
+ maximum size that the journal file is allowed to
+ be. Berkeley DB does not have a journal file, but
+ it writes and uses log files. A new log file is
+ created when the current log file has reached the
+ defined maximum size. To define this maximum size
+ for a log file, specify the
+ SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT flag. Default
+ value is 10 MB for the Berkeley DB SQL interface.
+ </dd>
</dl>
</div>
</div>
@@ -298,38 +380,38 @@ Default value is 10 MB for the Berkeley DB SQL interface.
<div class="titlepage">
<div>
<div>
- <h3 class="title"><a id="idp249752"></a>Enabling Extensions</h3>
+ <h3 class="title"><a id="idp698856"></a>Enabling Extensions</h3>
</div>
</div>
</div>
- <p>
- The Berkeley DB SQL API provides extensions such as full text
- search and R-Tree index. By default, these extensions are
- disabled. To enable an extension in the Berkeley DB SQL interface,
- specify the related option as an argument to the configure script
- using the standard environment variable, CPPFLAGS.
+ <p>
+ The Berkeley DB SQL API provides extensions such as
+ full text search and R-Tree index. By default, these
+ extensions are disabled. To enable an extension in the
+ Berkeley DB SQL interface, specify the related option as
+ an argument to the configure script using the standard
+ environment variable, CPPFLAGS.
</p>
- <p></p>
<div class="variablelist">
<dl>
<dt>
<span class="term">SQLITE_ENABLE_FTS3</span>
</dt>
<dd>
- Enable building the Berkeley DB full text search layer
+ Enable building the Berkeley DB full text
+ search layer
</dd>
<dt>
<span class="term">SQLITE_ENABLE_RTREE</span>
</dt>
- <dd>
- Enables the Berkeley DB R-Tree layer.
+ <dd> Enables the Berkeley DB R-Tree layer.
</dd>
</dl>
</div>
<p>
- See the SQLite Documentation for more information on
- <a class="ulink" href="http://www.sqlite.org/fts3.html" target="_top">full text search</a>
- and <a class="ulink" href="http://www.sqlite.org/rtree.html" target="_top">R-Tree</a>.
+ See the SQLite Documentation for more information on
+ <a class="ulink" href="http://www.sqlite.org/fts3.html" target="_top">full text
+ search</a> and <a class="ulink" href="http://www.sqlite.org/rtree.html" target="_top">R-Tree</a>.
</p>
</div>
<div class="sect2" lang="en" xml:lang="en">
@@ -340,28 +422,30 @@ Default value is 10 MB for the Berkeley DB SQL interface.
</div>
</div>
</div>
- <p>
- This section describes how to build the JDBC driver code using
- <code class="literal">autoconf</code>, which is the only method supported and
- tested by the Berkeley DB team.
+ <p>
+ This section describes how to build the JDBC driver
+ code using <code class="literal">autoconf</code>, which is the only
+ method supported and tested by the Berkeley DB team.
</p>
- <p>
- To build the JDBC driver, you must have Sun Java Development Kit
- 1.1 or above installed.
+ <p>
+ To build the JDBC driver, you must have Sun Java
+ Development Kit 1.1 or above installed.
</p>
<pre class="programlisting">cd build_unix
../dist/configure --enable-jdbc --prefix=&lt;install path&gt;
make install</pre>
<p>
- You can test the build by entering the following commands from the
- <code class="literal">build_unix/jdbc</code> directory:
+ You can test the build by entering the following
+ commands from the <code class="literal">build_unix/jdbc</code>
+ directory:
</p>
<table class="simplelist" border="0" summary="Simple list">
<tr>
<td>javac -classpath ./sqlite.jar test3.java</td>
</tr>
<tr>
- <td>java -Djava.library.path=./.libs -classpath ./sqlite.jar:. test3 </td>
+ <td>java -Djava.library.path=./.libs -classpath
+ ./sqlite.jar:. test3 </td>
</tr>
</table>
</div>
@@ -369,87 +453,98 @@ Default value is 10 MB for the Berkeley DB SQL interface.
<div class="titlepage">
<div>
<div>
- <h3 class="title"><a id="idp327120"></a>Using the JDBC Driver</h3>
+ <h3 class="title"><a id="idp704816"></a>Using the JDBC Driver</h3>
</div>
</div>
</div>
<p>
- This section describes how to download, build, and run sample
- programs using the built JDBC driver.
+ This section describes how to download, build, and run
+ sample programs using the built JDBC driver.
</p>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
- <h4 class="title"><a id="idp327616"></a>Downloading JDBC Sample Code</h4>
+ <h4 class="title"><a id="idp722352"></a>Downloading JDBC Sample Code</h4>
</div>
</div>
</div>
<p>
- The download link for JDBC sample code is available on the
- <a class="ulink" href="http://www.oracle.com/technetwork/java/index-139949.html" target="_top">
- Oracle Technology Network (OTN)
- </a> page. You can identify the link by the "JDBC
- programming examples from all three editions (ZIP format)" text
- beside it.
+ The download link for JDBC sample code is available
+ on the <a class="ulink" href="http://www.oracle.com/technetwork/java/index-139949.html" target="_top">
+ Oracle Technology Network (OTN) </a> page.
+ You can identify the link by the "JDBC programming
+ examples from all three editions (ZIP format)" text
+ beside it.
</p>
</div>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
- <h4 class="title"><a id="idp322288"></a>Modifying Sample Code</h4>
+ <h4 class="title"><a id="idp697912"></a>Modifying Sample Code</h4>
</div>
</div>
</div>
<p>
- Before running the example code, do the following:
+ Before running the example code, do the following:
</p>
<div class="orderedlist">
<ol type="1">
- <li>
- Unzip the file containing the sample code to a new
- directory (for example, jdbc_ex).
+ <li>
+ Unzip the file containing the sample code
+ to a new directory (for example, jdbc_ex).
</li>
<li>
- <p>
+ <p>
Substitute
- <code class="literal">jdbc:sqlite:/&lt;db-file-name&gt;</code> for
- the generic JDBC URL that appears in the code. That is, put
<code class="literal">jdbc:sqlite:/&lt;db-file-name&gt;</code>
- between the quotation marks in the line:
+ for the generic JDBC URL that appears in the
+ code. That is, put
+ <code class="literal">jdbc:sqlite:/&lt;db-file-name&gt;</code>
+ between the quotation marks in the line:
</p>
<p>
- <code class="literal">String url = "jdbc:mySubprotocol:myDataSource";</code>
+ <code class="literal">String url =
+ "jdbc:mySubprotocol:myDataSource";</code>
+ </p>
+ <p>
+ Note: The &lt;db-file-name&gt; can either
+ be an absolute path name like
+ <code class="literal">"jdbc:sqlite://jdbc_ex_db/myDataSource"</code>,
+ or a relative path-file-name like
+ <code class="literal">"jdbc:sqlite:/../jdbc_ex_db/myDataSource"</code>,
+ or a file name, like
+ <code class="literal">"jdbc:sqlite:/myDataSource"</code>,
+ in which case the database file will be stored
+ at the current directory. Note that all path
+ arguments require a leading slash, even in the
+ case of relative paths or a database in the
+ local directory. Please refer to the above
+ examples.
</p>
- <p>
- Note: The &lt;db-file-name&gt; can either be an
- absolute path name like
- <code class="literal">"/jdbc_ex_db/myDataSource"</code>, or a
- relative path-file-name like
- <code class="literal">"../jdbc_ex_db/myDataSource"</code>, or a
- file name, like <code class="literal">"myDataSource"</code>, in
- which case the database file will be stored at the current
- directory.</p>
</li>
<li>
- Substitute <code class="literal">SQLite.JDBCDriver</code> for
- <code class="literal">myDriver.ClassName</code> in the line:
- <code class="literal">Class.forName("myDriver.ClassName");</code></li>
+ Substitute
+ <code class="literal">SQLite.JDBCDriver</code> for
+ <code class="literal">myDriver.ClassName</code> in the
+ line:
+ <code class="literal">Class.forName("myDriver.ClassName");</code></li>
<li>
<p>
- Optionally substitute the username and password you use for your
- database in the following:
- <code class="literal">"myLogin", "myPassword"</code>.
+ Optionally substitute the username and
+ password you use for your database in the
+ following: <code class="literal">"myLogin",
+ "myPassword"</code>.
</p>
</li>
- <li>
- If your JDK version is above 1.5, change the variable name
- <code class="literal">enum</code> in
- <code class="literal">OutputApplet.java</code> to some other variable
- name because, as of JDK release 5 <code class="literal">enum</code>
- is a keyword and can not be used as an
- identifier.
+ <li>
+ If your JDK version is above 1.5, change
+ the variable name <code class="literal">enum</code> in
+ <code class="literal">OutputApplet.java</code> to some
+ other variable name because, as of JDK release 5
+ <code class="literal">enum</code> is a keyword and can
+ not be used as an identifier.
</li>
</ol>
</div>
@@ -458,44 +553,44 @@ Default value is 10 MB for the Berkeley DB SQL interface.
<div class="titlepage">
<div>
<div>
- <h4 class="title"><a id="idp323472"></a>Building and Running the JDBC Sample code</h4>
+ <h4 class="title"><a id="idp710816"></a>Building and Running the JDBC Sample code</h4>
</div>
</div>
</div>
- <p>
- See
- <a class="xref" href="build_unix_sql.html#build_unix_jdbc" title="Building the JDBC Driver">Building the JDBC Driver</a>
- for instructions on building the JDBC driver.
+ <p>
+ See <a class="xref" href="build_unix_sql.html#build_unix_jdbc" title="Building the JDBC Driver">Building the JDBC Driver</a> for instructions
+ on building the JDBC driver.
</p>
- <p>
- To build and run the JDBC examples do the following:
+ <p>
+ To build and run the JDBC examples do the
+ following:
</p>
<div class="orderedlist">
<ol type="1">
<li>
- Copy <code class="literal">build_unix/jdbc/sqlite.jar</code> and
+ Copy
+ <code class="literal">build_unix/jdbc/sqlite.jar</code>
+ and
<code class="literal">build_unix/jdbc/.libs/libsqlite_jni.so</code>
- to the <code class="literal">jdbc_ex</code> directory.
+ to the <code class="literal">jdbc_ex</code> directory.
</li>
<li>
- <p>
- In the <code class="literal">jdbc_ex</code> directory, run the
- following commands:
+ <p>
+ In the <code class="literal">jdbc_ex</code>
+ directory, run the following commands:
</p>
- <pre class="programlisting">
- $ javac -classpath ./sqlite.jar *.java
+ <pre class="programlisting">$ javac -classpath ./sqlite.jar *.java
$ java -classpath .:sqlite.jar -Djava.library.path=. \
- &lt;ClassName, eg. CreateCoffees&gt;
- </pre>
+ &lt;ClassName, eg. CreateCoffees&gt;</pre>
</li>
- <li>
- After you run the CreateCoffees example, use the
- <code class="literal">dbsql</code> executable to open the
- <code class="literal">myDataSource</code> database file and check if
- the table <code class="literal">COFFEES</code> has been successfully
- created in the database.
- <pre class="programlisting">
- $ dbsql myDataSourcedbsql&gt; .tables
+ <li>
+ After you run the CreateCoffees example,
+ use the <code class="literal">dbsql</code> executable to
+ open the <code class="literal">myDataSource</code> database
+ file and check if the table
+ <code class="literal">COFFEES</code> has been
+ successfully created in the database.
+ <pre class="programlisting">$ dbsql myDataSourcedbsql&gt; .tables
COFFEES
dbsql&gt; .dump
PRAGMA foreign_keys=OFF;
@@ -503,17 +598,16 @@ Default value is 10 MB for the Berkeley DB SQL interface.
CREATE TABLE COFFEES (COF_NAME varchar(32),\
SUP_ID int, PRICE float, SALES int, TOTAL int);
COMMIT;
- dbsql&gt;
- </pre></li>
+ dbsql&gt;</pre></li>
<li>
<p>
- Repeat step 3 to run other examples.
+ Repeat step 3 to run other examples.
</p>
<p>
- Note: Some examples, such as AutoGenKeys, are not yet
- supported by BDB JDBC driver. The
- <code class="literal">SQLFeatureNotSupportedException</code> is
- displayed for those unsupported examples.
+ Note: Some examples, such as AutoGenKeys,
+ are not yet supported by BDB JDBC driver. The
+ <code class="literal">SQLFeatureNotSupportedException</code>
+ is displayed for those unsupported examples.
</p>
</li>
</ol>
@@ -524,36 +618,36 @@ Default value is 10 MB for the Berkeley DB SQL interface.
<div class="titlepage">
<div>
<div>
- <h3 class="title"><a id="idp349152"></a>Building the ODBC Driver</h3>
+ <h3 class="title"><a id="idp736952"></a>Building the ODBC Driver</h3>
</div>
</div>
</div>
- <p>
+ <p>
This section describes how to build the ODBC driver.
</p>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
- <h4 class="title"><a id="idp342536"></a>Configuring Your System</h4>
+ <h4 class="title"><a id="idp730032"></a>Configuring Your System</h4>
</div>
</div>
</div>
<p>
- To configure your system prior to building the ODBC driver, do
- the following:
+ To configure your system prior to building the ODBC
+ driver, do the following:
</p>
<div class="orderedlist">
<ol type="1">
<li>
- Download and install the latest
- <a class="ulink" href="http://www.unixodbc.org" target="_top">unixODBC</a>
+ Download and install the latest <a class="ulink" href="http://www.unixodbc.org" target="_top">unixODBC</a>
if ODBC is not already installed on your system.
</li>
- <li>
- Configure the ODBC server to work with SQLite databases. Follow
- <a class="ulink" href="http://www.ch-werner.de/sqliteodbc/html/index.html" target="_top">these instructions</a>
- from Christian Werner.
+ <li>
+ Configure the ODBC server to work with
+ SQLite databases. Follow <a class="ulink" href="http://www.ch-werner.de/sqliteodbc/html/index.html" target="_top">
+ these instructions</a> from Christian
+ Werner.
</li>
</ol>
</div>
@@ -562,71 +656,79 @@ Default value is 10 MB for the Berkeley DB SQL interface.
<div class="titlepage">
<div>
<div>
- <h4 class="title"><a id="idp353984"></a>Building the Library</h4>
+ <h4 class="title"><a id="idp741624"></a>Building the Library</h4>
</div>
</div>
</div>
- <p>
- To build the library, do the following:
+ <p>
+ To build the library, do the following:
</p>
<pre class="programlisting">
- $ cd db-5.3.XX/build_unix
+ $ cd db-6.1.XX/build_unix
$ CFLAGS="-fPIC" ../dist/configure --enable-sql_compat --disable-shared
$ make
$ cd ../lang/sql/odbc
- $ CFLAGS="-DHAVE_ERRNO_H -I../../../build_unix -I../../../src/dbinc \
- -I../sqlite/src" LDFLAGS="../../../build_unix/libdb-5.3.a" \
+ $ CFLAGS="-D_HAVE_SQLITE_CONFIG_H \
+ -I../../../build_unix -I../../../build_unix/sql \
+ -I../../../src/dbinc -I../sqlite/src" \
+ LDFLAGS="../../../build_unix/libdb-6.1.a" \
./configure --with-sqlite3=../generated
- $ make
- </pre>
+ $ make</pre>
<p>
- The <code class="literal">libsqlite3odbc.so</code> library containing a
- statically linked version of Berkeley DB SQL is now
- built.
+ The <code class="literal">libsqlite3odbc.so</code> library
+ containing a statically linked version of Berkeley DB
+ SQL is now built.
</p>
<p>
- NOTE: The final <code class="literal">make</code> command above is known
- to generate a warning when using GCC. The warning states:
- <code class="literal">Warning: Linking the shared library libsqlite3odbc.la
- against the static library ../../build_unix/libdb-5.3.a is
- not portable!</code>. It is generally safe to ignore the
- warning when using the generated library.
+ NOTE: The final <code class="literal">make</code> command
+ above is known to generate a warning when using GCC.
+ The warning states: <code class="literal">Warning: Linking the
+ shared library libsqlite3odbc.la against the
+ static library
+ ../../build_unix/libdb-6.1.a is not
+ portable!</code>. It is generally safe to
+ ignore the warning when using the generated library.
</p>
</div>
<div class="sect3" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
- <h4 class="title"><a id="idp357536"></a>Testing the ODBC Driver</h4>
+ <h4 class="title"><a id="idp745064"></a>Testing the ODBC Driver</h4>
</div>
</div>
</div>
<p>
- The steps to verify that the installed driver works are as follows:
+ The steps to verify that the installed driver works
+ are as follows:
</p>
<div class="orderedlist">
<ol type="1">
- <li>
- Alter the <code class="literal">/etc/odbcinst.ini</code> and
- <code class="literal">~/.odbc.ini</code> configuration files to refer
- to the libsqlite3odbc.so file built above.
+ <li>
+ Alter the
+ <code class="literal">/etc/odbcinst.ini</code> and
+ <code class="literal">~/.odbc.ini</code> configuration
+ files to refer to the libsqlite3odbc.so file built
+ above.
</li>
<li>
- <p>
- Create a data source, and launch a data source viewer
- application by doing the following:
+ <p>
+ Create a data source, and launch a data
+ source viewer application by doing the
+ following:
</p>
<pre class="programlisting">$ mkdir ~/databases
$ cd ~/databases
$ /path/to/Berkeley DB/build_unix/sqlite3 mytest.db
dbsql&gt; CREATE TABLE t1(x);
- dbsql&gt; .quit;
+ dbsql&gt; .quit
$ DataManager </pre>
- <p>
- The final step opens a GUI application that displays
- ODBC data sources on a system. You should be able to
- find the <code class="literal">mytest.db</code> data source just
- created.
+ <p>
+ The final step opens a GUI application that
+ displays ODBC data sources on a system. You
+ should be able to find the
+ <code class="literal">mytest.db</code> data source
+ just created.
</p>
</li>
</ol>
@@ -641,12 +743,13 @@ Default value is 10 MB for the Berkeley DB SQL interface.
</div>
</div>
</div>
- <p>
- The BFILE extension allows you to store binary files outside of
- the database, but still operate upon them as if they were
- stored within the database. To enable this extension, use the
- <code class="literal">--enable-load-extension</code> configuration flag.
- For example:
+ <p>
+ The BFILE extension allows you to store binary files
+ outside of the database, but still operate upon them as if
+ they were stored within the database. To enable this
+ extension, use the
+ <code class="literal">--enable-load-extension</code>
+ configuration flag. For example:
</p>
<pre class="programlisting">$ cd &lt;db&gt;/build_unix
$ export DBSQL_DIR=$PWD/../install
@@ -658,25 +761,26 @@ $ make &amp;&amp; make install</pre>
BFILE extensions are only supported for Unix platforms.
</p>
<p>
- Note that the extension support has two
- interfaces: SQL expressions and a C-functions API. By default,
- the SQL expressions are built when you use
+ Note that the extension support has two interfaces: SQL
+ expressions and a C-functions API. By default, the SQL
+ expressions are built when you use
<code class="literal">--enable-load_extension</code>. To use the
- C-functions API, edit <code class="literal">&lt;db&gt;/lang/sql/ext/bfile/build/Makefile</code>
- and set <code class="literal">ENABLE_BFILE_CAPI</code>
- to <code class="literal">1</code>.
+ C-functions API, edit
+ <code class="literal">&lt;db&gt;/lang/sql/ext/bfile/build/Makefile</code>
+ and set <code class="literal">ENABLE_BFILE_CAPI</code> to
+ <code class="literal">1</code>.
</p>
- <p>
- Once you have enabled the extension and built the library, you
- can run the included example:
+ <p>
+ Once you have enabled the extension and built the
+ library, you can run the included example:
</p>
<pre class="programlisting">$ cd lang/sql/sqlite/ext/bfile/build
$ export LD_LIBRARY_PATH=$PWD:$DBSQL_DIR/lib
$ ./bfile_example_sql # for SQL expressions interface
$ ./bfile_example_capi # for C-functions API</pre>
- <p>
- For more information on using the BFILE extension, see the
- <em class="citetitle">Berkeley DB Getting Started with the SQL APIs</em> guide.
+ <p>
+ For more information on using the BFILE extension, see
+ the <em class="citetitle">Berkeley DB Getting Started with the SQL APIs</em> guide.
</p>
</div>
</div>