从脚本中填充内存hsqldb数据库 [英] populating in memory hsqldb database from script
问题描述
有没有办法可以在指向我的内存hsqldb实例的连接字符串中指定脚本?
Is there a way that I can specify a script in the connection string pointing to my in memory hsqldb instance?
我正在看这个文章它看起来有可能,但我不确定如何正确地制定字符串或放置脚本文件的位置。查看hsqldb文档此处似乎并非如此。
I was looking at this article and it looks like it is possible, but I'm not sure how to formulate the string correctly or where to put the script file. Looking at the hsqldb documentation here it doesn't appear to be the case.
我可以选择在java测试中使用它吗?
What would my options here be for using this from java tests?
这与以前的hsqldb有关问题在这里从单元测试中启动和停止hsqldb
This is related to a previous hsqldb question here starting and stopping hsqldb from unit tests
推荐答案
使用文件:database而不是mem:,但在属性文件中包含files_readonly = true。测试期间对数据库的更改将不会保留。
Use a file: database instead of mem:, but include "files_readonly=true" in the properties file. Changes to the database during tests will not be persisted.
这篇关于从脚本中填充内存hsqldb数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!