There are a set of configuration options to assist you in building the Berkeley DB SQL interface. These configuration options include:
The following configuration options are useful when debugging applications:
Any arguments that you can provide to the standard SQLite configure script can also be supplied when configuring Berkeley DB SQL interface.
The Berkeley DB SQL API provides extensions such as full text search and R-Tree index. By default, these two 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.
See the SQLite Documentation for more information on full text search and R-Tree.
This section describes how to build the JDBC driver code using autoconf
, which is the only method supported and tested by the Berkeley DB team.
To build the JDBC driver, you must have Sun Java Development Kit 1.1 or above installed.
cd build_unix CFLAGS="-fPIC" ../dist/configure --enable-sql_compat --disable-shared make cd ../sql/jdbc CFLAGS="-DHAVE_SQLITE3_MALLOC -DHAVE_ERRNO_H \ -I../../build_unix -I../../dbinc" \ LDFLAGS="../../build_unix/libdb-5.0.a" \ ./configure --with-sqlite3=../generated make
Note: The defined process is known to generate a link warning during the final step. The warning is generated by libtool when linking a library without a library information file present (.la). It is safe to ignore the warning. If you have problems when using the JDBC driver, use the shared library version of Berkeley DB.
You can test the build by entering the following commands from the sql/jdbc
directory:
javac -classpath ./sqlite.jar test3.java |
java -Djava.library.path=./.libs -classpath ./sqlite.jar:. test3 |
This section describes the steps required to build the ODBC driver.
To configure your system prior to building the ODBC driver, do the following:
To build the library, do the following
$ cd db-5.0.XX/build_unix $ CFLAGS="-fPIC" ../dist/configure --enable-sql_compat --disable-shared $ make $ cd ../sql/odbc $ CFLAGS="-DHAVE_ERRNO_H -I../../build_unix -I../../dbinc \ -I../sqlite/src" LDFLAGS="../../build_unix/libdb-5.0.a" \ ./configure --with-sqlite3=../generated $ make
The libsqlite3odbc.so
library containing a statically linked version of Berkeley DB SQL is now built.
NOTE: The final make
command above is known to generate a warning when using GCC. The warning states: Warning: Linking the shared library libsqlite3odbc.la against the static library ../../build_unix/libdb-5.0.a is not portable!
. It is generally safe to ignore the warning when using the generated library.
The steps to verify that the installed driver works are as follows:
/etc/odbcinst.ini
and ~/.odbc.ini
configuration files to refer to the libsqlite3odbc.so file built above.Create a data source, and launch a data source viewer application by doing the following:
$ mkdir ~/databases $ cd ~/databases $ /path/to/Berkeley DB/build_unix/sqlite3 mytest.db dbsql> CREATE TABLE t1(x); dbsql> .quit; $ DataManagerThe final step opens a GUI application that displays ODBC data sources on a system. You should be able to find the
mytest.db
data source just created.