Max Korytko’s Blog

November 11, 2009

HSQL in file DB

Filed under: Uncategorized — maxkorytko @ 6:35 pm

Suppose you use HSQL in-file database, and you want to be able to execute SQL commands against it.
Suppose your set up is like so:

  • script file is mydatabase.script and it’s located in  D:\Development\project\mydatabase.script
  • HSQL is located in D:\hsqld

Here is what you need to do:

Start an instance of the HSQL server:

cd D:\Development\project

java -cp D:\hsqldb\lib\hsqldb.jar org.hsqldb.Server -database.0 file:project -dbname.0 mydatabase

Connect to it with the HSQL manager. Provide the following connection string:

jdbc:hsqldb:file:D:\Development\project\mydatabase

You should now be able to see the tables in the database and execute SQL commands agains them.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.