试图在没有运气的情况下独立运行和访问HSQLDB

时间:2013-04-30 18:11:19

标签: java hsqldb

我试图在没有运气的情况下独立运行和访问HSQLDB ..

我启动了数据库,得到了以下输出:

@wcmisdlin07 ~/Downloads/hsqldb-2.2.9/hsqldb/bin> ./runServer.bat 
: No such file or directory: ..data
[Server@7e896e10]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@7e896e10]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@7e896e10]: Startup sequence initiated from main() method
[Server@7e896e10]: Could not load properties from file
[Server@7e896e10]: Using cli/default properties only
[Server@7e896e10]: Initiating startup sequence...
[Server@7e896e10]: Server socket opened successfully in 7 ms.
[Server@7e896e10]: Database [index=0, id=0, db=file:test, alias=] opened sucessfully in 690 ms.
[Server@7e896e10]: Startup sequence completed in 698 ms.
[Server@7e896e10]: 2013-04-30 13:59:44.616 HSQLDB server 2.2.9 is online on port 9001
[Server@7e896e10]: To close normally, connect and execute SHUTDOWN SQL
[Server@7e896e10]: From command line, use [Ctrl]+[C] to abort abruptly

我试图使用以下URL在java中访问它:

jdbc:hsqldb:hsql://localhost/xdb

但是如果你看一下控制台,我会收到以下错误:

[Server@7e896e10]: [Thread[HSQLDB Connection @343d0d2b,5,HSQLDB Connections @7e896e10]]: database alias=mydb does not exist
[Server@7e896e10]: [Thread[HSQLDB Connection @7d52cb9a,5,HSQLDB Connections @7e896e10]]: database alias=test does not exist
[Server@7e896e10]: [Thread[HSQLDB Connection @5c1fbd9,5,HSQLDB Connections @7e896e10]]: database alias=xdb does not exist
[Server@7e896e10]: [Thread[HSQLDB Connection @231d06f0,5,HSQLDB Connections @7e896e10]]: database alias=testdb does not exist
[Server@7e896e10]: [Thread[HSQLDB Connection @545c498e,5,HSQLDB Connections @7e896e10]]: database alias=xdb does not exist

那么有人可以告诉我默认的数据库名称或如何创建一个名称?

1 个答案:

答案 0 :(得分:3)

How-To表示您必须创建一个server.properties文件并将其放在您安装hsqldb的目录中,该文件包含:

server.database.0=file.hsqldb/dirWhereDbLives   
server.dbname.0=xdb