hsqldb.org Home

HSQLDB - 100% Java Database

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
Can I use HSQLDB in my program
Reliability, Performance and Deployment


How to install and run HSQLDB

How to compile HSQLDB

You don't need to. A compiled JAR of HSQLDB is included in the download. This runs under Java 8, 9 and 10. Java 5 and Java 6 jar downloads are also available from the support page. If you want to re-compile HSQLDB, you will need a JDK. See the Guide and the documentation in the /build directory.

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'  (or any other name)  and a password (can be an empty string). You will use this name and password to connect again.

How to start programming JDBC / HSQLDB

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

Basic sample programs are in the /src/org/hsqldb/sample folder.

Source code of test programs are useful examples of how to use different features of JDBC and SQL. Check the sources in the /src/org/hsqldb/test folder.

SQL test scripts are in the /runtest folder and offer extensive examples of SQL statements.

Where to get more Documentation

HSQLDB has a standard JDBC interface. HSQLDB specific JDBC documentation is included in the /doc/src folder.

There are also many books available on JDBC programming.

HSQLDB is covered in hundreds of books on Java programming. Search Google Books for "HSQLDB"

How to use HSQLDB inside Eclipse, etc.

To use HSQLDB at design-time in JBuilder, Eclipse, NetBeans 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. A dedicated plugin is already available for Eclipse.

How to upgrade from an old version to the current version

It is recommended that you close version 1.8.x databases with the SHUTDOWN command before they are opened with version 2.x. If the database is not read-only, it will be upgraded to the latest version.

If you use CACHED tables, the procedures in the System Management and Deployment Issues section of the Guide should be followed. A SHUTDOWN COMPACT after the upgade is recommended.

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


Reliability, Performance and Deployment


SourceForge Logo

This page last updated 25 May 2011
Java is a Trademark of Sun Microsystems, Inc. (under various licenses). Contents of this page are ©2001-2011 The hsql Development Group. All rights reserved under the terms of the applicable Licenses.