hsqldb.org Home Page hsqldb - 100% Java Database

Lightweight 100% Java SQL Database Engine
A Project of the hsqldb Development Team

General
<Download> <News><Project Page> <License>
Contact and Support
<Support> <FAQ>
Documentation and Development
<Features> <Documentation> <Developers> <Changes>

How To / FAQ


How to install and run HSQLDB
How to compile HSQLDB
How to create a new database
How to start programming JDBC / HSQLDB
Where to get more documentation
How to use HSQLDB inside JBuilder
How to upgrade from an old version


Frequently Asked Questions

Documentation



How to install and run HSQLDB


How to compile HSQLDB

A compiled JAR of HSQLDB is included in the download. This runs under JRE 1.4 or later. If you want to re-compile for other JDK's, you will need a Java compiler. See the documentation in the /build directory.

Command line compiler tools are included in the free JDK (Java Development Kit) from Sun.


How to create a new database

A new database is created automatically if it does not yet exist. Just connect to the not-yet-existing database using the jdbc:hsqldb:file:«database-path» URL (should replace the last part with the path you want) with the user 'sa' and an empty password.


How to start programming JDBC / HSQLDB

HSQLDB comes with documentation, example applets and source code that can help programers who are new to JDBC programming.

An example application is in the guide. Another example is FindFile.java in the /src/org/hsqldb/sample folder. This is a tool to search files. The source code of this demo application is well documented, and the functionality is kept low, so it should be easy to understand what is going on just reading the source code.

Because the source code of all other tools and applets is also included in the download, more advanced programmers will find some hints there. Check the sources in /src/org/hsqldb/sample and /src/org/hsqldb/test folders.


Where to get more Documentation

HSQLDB has a standard JDBC interface that is supported by most databases. The JDBC interface is well documented in the JDK. Additionally, HSQLDB specific JDBC documentation is included in the /doc/src folder.

There are also many books available on JDBC programming.

For people who are interested in the database engine design of HSQLDB, the source code is where to look.


How to use HSQLDB inside JBuilder, Eclipse, etc.

To use HSQLDB at design-time in JBuilder, Eclipse or other tools, you usually require the plug-in for databases that comes with the development environment. You usually need to add a reference to the HSQLDB jar to the environment. Also you normally need to register the JDBC driver (which is part of the hsqldb.jar) with the environment.


How to upgrade from an old version to the current version

An old version database can always be opened by the latest version and automatically converted if there is no CACHED table data in the database (the *.data file is empty or does not exist).

It is often possible to open old databases with CACHED tables too. But sometimes a manual upgrade is necessary. The upgrade can be done like this.

Databases created with versions before 1.7.0 could have issues such as those listed below. Such errors are not accepted by 1.7.2:

Note that an upgrade is a one-way process, so please always keep a backup of the old database.


Frequently Asked Questions

 

This text is based on HypersonicSQL documentation, updated to reflect the latest version of HSQLDB

SourceForge Logo

This page last updated 29 November 2004
Java is a Trademark of Sun Microsystems, Inc. (under various licenses). Contents of this page are ©2001-2004 The hsqldb Development Group. All rights reserved under the terms of the applicable Licenses. Questions and comments about this page may be addressed to the Webmaster.