以编程方式设置 derby.system.home
需要将 JavaDB (derby) db 文件的数据库和日志文件移动到部署目录中。数据库正在应用程序启动目录中工作,因为 JavaDB 创建了一个名为数据库名称的文件夹(在我的例子中为 mydb),但我想将该目录移动到名为 data/create data/mydb 的子目录中。我可以通过 connect 调用来做到这一点:
DriverManager.getConnection("jdbc:derby:data/mydb;create=false");
并且这有效。但我想以编程方式显式设置
derby.system.home=data/
的值 derby.stream.error.file=log/derby.log
所以我可以这样做:
DriverManager.getConnection("jdbc:derby:mydb;create=false");
所有数据库都将位于该 data/ 目录中。德比日志文件将位于logs/!我似乎无法弄清楚这一点。有人帮忙吗?有没有办法以编程方式设置这些属性(因为它是嵌入的)?
Need to move the database and log files of JavaDB (derby) db files into deployment directories. The database is working in the application startup directory as JavaDB creates a folder with the name of the database (in my case mydb), but I want to move that dir into a subdir called data/ creating data/mydb. I can do this with the connect call:
DriverManager.getConnection("jdbc:derby:data/mydb;create=false");
and this works. But I'd like to programmatically explicitly set the value of
derby.system.home=data/
derby.stream.error.file=log/derby.log
So I can do:
DriverManager.getConnection("jdbc:derby:mydb;create=false");
and all dbs would be in that data/ dir. And the derby log file would be in logs/! I just can't seem to figure this out. Anyone help? Is there a way to set those properties programatically (because it's embedded)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文档(Derby 开发人员指南:设置 Derby 属性) 建议了一些内容喜欢:
我也看过
The documentation (Derby developers guide: Setting Derby properties) suggests something like:
I've also seen