HSQLDB别名不存在,linux sh脚本

时间:2021-01-02 23:07:33

The problem is that when my hsql server starts, it tells that the alias exists, everything connected successfully:

问题是当我的hsql服务器启动时,它告诉别名存在,所有连接成功:

rpi@RaspberryPi:/home/snb/update_skynetwork/apps/App/bin$ sh skysql.sh
/home/snb/update_skynetwork/apps/App/lib/hsqldb-2.2.8.jar
[Server@133796]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@133796]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@133796]: Startup sequence initiated from main() method
[Server@133796]: Could not load properties from file
[Server@133796]: Using cli/default properties only
[Server@133796]: Initiating startup sequence...
[Server@133796]: Server socket opened successfully in 7 ms.
] opened sucessfully in 1462 ms.=0, id=0,   db=file:/home/snb/update_skynetwork/apps/App/sky-network-hsqldb/sky-network-hsqldb,       alias=sky-network-hsqldb
[Server@133796]: Startup sequence completed in 1473 ms.
[Server@133796]: 2012-12-20 10:23:11.843 HSQLDB server 2.2.8 is online on port 9001  
[Server@133796]: To close normally, connect and execute SHUTDOWN SQL
[Server@133796]: From command line, use [Ctrl]+[C] to abort abruptly

But when I try to connect with my java app I receive this error:

但是当我尝试连接我的java应用程序时,我收到此错误:

-on server:

-on服务器:

[Server@133796]: [Thread[HSQLDB Connection @bdb503,5,HSQLDB Connections @133796]]: database alias=sky-network-hsqldb does not exist
[Server@133796]: [Thread[HSQLDB Connection @110003,5,HSQLDB Connections @133796]]: database alias=sky-network-hsqldb does not exist
[Server@133796]: [Thread[HSQLDB Connection @175d6ab,5,HSQLDB Connections @133796]]: database alias=sky-network-hsqldb does not exist

-on client:

- 客户:

Caused by: org.hsqldb.HsqlException: General error: database alias does not exist
at org.hsqldb.error.Error.error(Unknown Source)
at org.hsqldb.ClientConnection.<init>(Unknown Source)
... 16 more

I have tried to test the connection with the sqltool, but still the same. Also, I have checked the alias name in the properties of client - all the same, like needed. The jars of hsql are the same. Everything matches.

我试图测试与sqltool的连接,但仍然是相同的。此外,我已检查客户端属性中的别名 - 所有相同,如需要。 hsql的jar是一样的。一切都很匹配。

As OS I have a Raspberry-pi VM.

作为操作系统,我有一个Raspberry-pi VM。

EDIT

编辑

This is my sqltool.sh :

这是我的sqltool.sh:

#! /bin/sh -e

export CLASSPATH=../lib/hsqldb-2.2.8.jar:$CLASSPATH
export CLASSPATH=../lib/sqltool.jar:$CLASSPATH

java -classpath $CLASSPATH org.hsqldb.cmdline.SqlTool --    inlineRc=url=jdbc:hsqldb:hsql://localhost/sky-network-hsqldb,user=SA,password=

1 个解决方案

#1


1  

It seems the only possible issue is shell script.

似乎唯一可能的问题是shell脚本。

Can you use a simple name for the alias, without hyphens.

你可以使用一个简单的名称作为别名,没有连字符。

The database file name should be OK with the hyphens.

使用连字符的数据库文件名应该没问题。

The server message states you do not have a server.properties file. In this case, the database file path and the name/alias should be on the command line. Please check your shell script and report / change the line that starts the server.

服务器消息指出您没有server.properties文件。在这种情况下,数据库文件路径和名称/别名应位于命令行上。请检查您的shell脚本并报告/更改启动服务器的行。

#1


1  

It seems the only possible issue is shell script.

似乎唯一可能的问题是shell脚本。

Can you use a simple name for the alias, without hyphens.

你可以使用一个简单的名称作为别名,没有连字符。

The database file name should be OK with the hyphens.

使用连字符的数据库文件名应该没问题。

The server message states you do not have a server.properties file. In this case, the database file path and the name/alias should be on the command line. Please check your shell script and report / change the line that starts the server.

服务器消息指出您没有server.properties文件。在这种情况下,数据库文件路径和名称/别名应位于命令行上。请检查您的shell脚本并报告/更改启动服务器的行。