[英]HyperSQL Server 2.4.1 creating new database during runtime
I have quick question. 我有一个快速的问题。 Is it possible to add new database when HSQL Server is running? HSQL Server运行时是否可以添加新数据库?
Quick view: 快速浏览:
Is it possible? 可能吗?
There is easy for many database systems but for HSQL I cannot find anything... 许多数据库系统都很容易,但是对于HSQL我什么也找不到。
You need to start the server in a special remote_open
mode which allows new databases to be opened. 您需要以特殊的remote_open
模式启动服务器,该模式允许打开新数据库。 In addition, you need to specify the file path of the new database when you connect. 另外,在连接时,您需要指定新数据库的文件路径。 When the server is started, check the messages for remote-open
. 启动服务器后,检查消息中的remote-open
。 Then connect with a URL like this jdbc:hsqldb:hsql://localhost/testx;file:mytextxfile
In the URL testx
is the network id of the database and file:mytextxfile
is the file path of the database files. 然后,使用这样的URL连接jdbc:hsqldb:hsql://localhost/testx;file:mytextxfile
在URL中, testx
是数据库的网络ID,而file:mytextxfile
是数据库文件的文件路径。
Server messages when it starts: 服务器消息启动时:
[Server@4c5e176f]: Startup sequence initiated from main() method
[Server@4c5e176f]: Loaded properties from [C:\ft\hsqldb_w_1_8_0_n_work\server.properties]
[Server@4c5e176f]: [Thread[main,5,main]]: start() entered
[Server@4c5e176f]: [Thread[HSQLDB Server @4c5e176f,5,main]]: run() entered
[Server@4c5e176f]: Initiating startup sequence...
[Server@4c5e176f]: [Thread[HSQLDB Server @4c5e176f,5,main]]: server.maxdatabases=10
[Server@4c5e176f]: [Thread[HSQLDB Server @4c5e176f,5,main]]: server.remote_open=true
[Server@4c5e176f]: [Thread[HSQLDB Server @4c5e176f,5,main]]: server.tls=false
....
Server messages when connecting to new database: 连接到新数据库时的服务器消息:
[Server@4c5e176f]: [Thread[HSQLDB Connection @63db6942,5,HSQLDB Connections @4c5e176f]]: 2:Trying to connect user 'SA' to DB (testx;file:mytextxfile)
[Server@4c5e176f]: [Thread[HSQLDB Connection @63db6942,5,HSQLDB Connections @4c5e176f]]: 2:Connected user 'SA'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.