开发者

hsqldb schema creation

开发者 https://www.devze.com 2023-01-27 13:11 出处:网络
I have some troubles with this problem: when user starts an application(web-based on Spring) for the first time, it should automatically create a schema (e.开发者_开发百科g. \"MY_SCHEMA\") and create

I have some troubles with this problem: when user starts an application(web-based on Spring) for the first time, it should automatically create a schema (e.开发者_开发百科g. "MY_SCHEMA") and create 2 tables. Then it can work with them. But if application starts again, the "MY_SCHEMA" should be already exist, so the application should only load this schema without creating tables and so on...

How to it?


HSQLD is primary used as a memory database. You can change your tables to persistent tables. It is documented here.

Another option that I prefere is to use another database like MySql that by default persists the tables to disk.


HSQLDB can be configured to run both with an in-memory database and a database persisted in a file. Please check the documentation available on HSDBL website (http://hsqldb.org/doc/guide/ch01.html#N100F3). I think you're settings use the in-memory database.

Espen is right, HSQLDB is usually used as an in-memory database.

0

精彩评论

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

关注公众号