Take the 2-minute tour ×

I have a problem about hsqldb database. Firstly I want to ask where hsqldb keep data in file system, it keeps in directory which we give in the jdbc URL,doesn't it? Secondly, after test finished I want to clear all of the things about data and files that is created for test. Which procedure I should follow?

share|improve this question
add comment

2 Answers

Answer to your first question is yes - hsqldb creates a directory and stores everything it needs for the database there.

2nd question - if you want to start over from scratch with an empty database, you can delete the created directory, and the JDBC driver will recreate it when you try to connect. My guess is though that you want to keep the database intact, but just remove your test data? In that case you will need a cleanup script to explicitly remove the rows that you added. This usually lives in a 'teardown' function of your test case.

share|improve this answer
For first question I want to ask does hsqldb keep also inserted data actually. For second question, I want to drop schema and delete all files that is created by hsqldb. So I've tried to DROP SCHEMA PUBLIC CASCADE and it doesn't matter I think, because my database.lof file is still there. What kind of operation can I do to format all of the things? –  Gül ÇABUK Mar 25 '11 at 15:24
Yes, they should keep your inserted data as long as the files exist. For the second, if you really want the files gone, try deleting the directory instead of going through the JDBC driver –  Roy Truelove Mar 25 '11 at 15:31
I tried the delete all files in the created directory but the log file - that is created by hsqldb stayed there (for example "exampleDB.log") –  Gül ÇABUK Mar 25 '11 at 15:47
add comment

You might want to use an in-memory HSQL database.

share|improve this answer
add comment

Your Answer


