How to export and restore HSQLDB [closed]

做~自己de王妃 提交于 2020-01-01 04:49:06

问题


Does anyone know how to export HSQLDB to .sql file or something on a computer and restore on other computer.


回答1:


To get a dump of the hsqldb file using either the embedded or file/server mode.

In an sql tools dialog use:

SCRIPT 'c:\path\to\db\db_sql.sql';

This will not work with spaces in the path

Please see the hsqldb docs




回答2:


I was trying to export an HSQLDB database, out of an ODB file no less, and found it was very unintuitive. Oddly, I rarely found any tutorials or docs on just a simple export (the kind that is often done with, say, SQLite). I figured the included SqlTool was the right answer, but found nothing obvious ("You might use SCRIPT" is not helpful, sorry). Because this wasn't a database I knew anything about, I couldn't specify schema/table names, nor could I figure out a way to discover those.

In the end, I used an eval copy of RazorSQL (http://razorsql.com). I had to rename the database files to be .script, etc., according to RazorSQL's docs. I set up a Connection Profile that used the "JDBC (HSQLDB embedded)" connection type, selecting the script file that I found in the ODB database. Then I selected DB Tools from the menu, then Export Data, and selected the options that seemed appropriate (CSV file, in my case).

Hope this helps someone else.



来源:https://stackoverflow.com/questions/8059748/how-to-export-and-restore-hsqldb

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