Tuesday, December 9, 2008

How to run a stand alone HSQLDB database as a service

HSQLDB database is an open source database fully written in Java. It's light weight and supports wide range of SQL standard. As I already mentioned it's fully written in Java and it can run standalone or within your Java application.

So you can embed it in your own application as a library. All you need is to include hsqldb.jar (593KB) file in your libs folder.

Also it's a great database to use while working on your project. You can add it as a target in your Ant build or in Maven.

Anyway, it's a great tool to have in your "Web Developers Toolkit". Back to the point. I needed it to run continuously in the background since my IDE reads data from it to make my life easier. So this is what you need to run in your console to run HSQLDB in the background:

java -classpath /path/to/hsqldb.jar org.hsqldb.Server

To stop the service press CTRL+C.

No comments: