Documentation/How Tos/Using SQLite With

From Apache OpenOffice Wiki
< Documentation‎ | How Tos
Revision as of 15:48, 16 August 2007 by Fpe (Talk | contribs)

Jump to: navigation, search



The aim of this guide is to help users to take advantage of the SQLite database engine as a data source.

What is SQLite?

SQLite is a basic database engine that implements most of the features of SQL92. Unlike PostgreSQL and MySQL, SQLite stores a whole data base with all its tables a single file. Other benefits are: database access requires no database server, database files can be freely shared between machines with different byte orders and databases can be up to 2 terabytes (241 bytes) in size. Plus it is fast (twice as much as PostgreSQL and MySQL for most operations) and has a small memory footprint.

Data management can be achieved in the following ways:

  1. Via a C/C++ Linux library or Windows DLL.
  2. Via an in-line program (sqlite: available under Linux and Windows) that makes it possible to create and to manage the files of data bases.
  3. Via the SQLite PHP module or, if you have, PHP version 5 internally to a SQLite database.
  4. Via ODBC (Linux and Windows) which allows any application supporting this standard to reach a SQLite database.
  5. Using the experimental SDBC SQLite driver

This guide addresses ODBC which uses to attach to databases and SQLite, in particular.

Why use SQLite with

The use of SQLite has many advantages:

  • The data base is in only one file, in contrast to dBASE which creates a file per table, making it easy to exchange databases between various users.
  • Java JRE or SDK is not required to support SQLite.
  • No server is needed (local or remote) to access a database.
  • ODBC drivers exist for *NIX and for Windows, thus enabling users of both environments to access data and exchange them.
  • A new SDBC driver (native to is available for experimentation.
  • Sophisticated graphic interfaces, such as those of msaccess, can be easily developed using the forms, queries, states and macros of These interfaces are stored separately in OpenOffice separate and can also be exchanged between users under UNIX or Windows.

and some disadvantages:

  • Modifying the structure of a SQLite table after its creation is not directly possible. This means that you cannot easily add fields nor to modify their properties once that the table is created. Therefore you must prepare the structure of your tables before creating them.
  • requires the use of the ODBC driver for accessing a SQLite database thus making this operation somewhat complicated. First it must be declared in ODBC and then in The native SDBC driver should correct this situation when it is production ready.
  • The initial database file cannot be created with but by using other tools.

In short, the principal advantages of the use of SQLite with are the format of data storage and the portability from one environment to another. In the list of disadvantages, the two last are not specific to SQLite, but are requirements of using ODBC. However, these are not as awkward as they do not take place during the initial creation of the database.


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools