Has HSQLDB some mechanism to save in-memory data to file?

末鹿安然 提交于 2019-11-30 18:40:51

HSQLDB databases are of different types. The all-in-memory databases do not store the data to disk. These databases have URLs in the form jdbc:hsqldb:mem:<name>.

If your database URL is in the form jdbc:hsqldb:file:<file path> and your tables are the default MEMORY tables, the data is all in memory but the changes are written to a set of disk files.

With all types of database, including all_in_memory, you can use the SQL statement SCRIPT <file path> to save the full database to a file. If you save the data to a file with the .script extension, you can open the file as a file database.

When you run a server, the URL's are used without the jdbc:hsqldb prefix, for example server.database.0=file:C:/myfile

See the guide here http://hsqldb.org/doc/2.0/guide/running-chapt.html#running_db-sect

There is an SQL command for that. Try this:

SCRIPT '/tmp/data.sql'

See here for details.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!