开发者

HSQLDB delete all data and and configuration files

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 finis开发者_JAVA技巧hed I want to clear all of the things about data and files that is created for test. Which procedure I should follow?


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜