HSQLDB server server username / password

If I run HSQLDB in server mode using Java code, the server starts without any problems. However, when I try to connect to it either through Java code or through HSQLDB DatabaseManagerSwing; I can not connect.

I started the server with user = conn1 and password = conn1 in memory only mode. But when connecting to the server, this gave me the following exception:

java.sql.SQLInvalidAuthorizationSpecException: invalid authorization specification - not found: conn1

I can only connect using user = SA and an empty password. I am using HSQLDB 2.2.5 and JRE1.7 on a Windows7 machine.

Can someone tell me where I am doing wrong?

+5
source share
4 answers

2.2.6, , , , . "server.username" "server.password" . dbname.0 .

, SA, :

server.database.0 = file:E:/DB/myDB;user=test;password=test
server.dbname.0 = mydb

. . .

+12

, ( , ), , HSQL " " ( , " ", is sa). . ( ) , . , SA, , , " ". ( ).

( , , ), :

// change the MySpecialTestDb String for multiple different in memory databases
// or reuse the same value
// to reconnect to a previously created in memory database [i.e. within the same process previously].
String DB_CONNECTION_STR = "jdbc:hsqldb:mem:MySpecialTestDb"; 
String DB_USERNAME_STR = "sa";
String DB_USERNAME_PASSWORD = "";
DriverManager.getConnection(DB_CONNECTION_STR, DB_USERNAME_STR, DB_USERNAME_PASSWORD);

ref: http://www.hsqldb.org/doc/1.8/guide/guide.html#advanced-chapter

, "reset" , , unit test, . .

+3

№ 1) , , . ; .

script , , : -

CREATE USER "usr" PASSWORD DIGEST '9003d1df22eb4d3820015070385194c8'
ALTER USER "usr" SET LOCAL TRUE
GRANT DBA TO "usr"

"usr", script . . .

, .

№ 2) , DB . , . .

, ,

1) lib HSQL

cd C:\Users\owner\Documents\Java Project\hsqldb-2.2.9\hsqldb\lib

java -cp hsqldb.jar org.hsqldb.Server -database.0 file:"C:\Users\owner\Documents\Java Project\hsqldb-2.2.9\TmpDBLocation\myKauDB" -dbname.0 xdb

2) lib

cd C:\Users\owner\Documents\Java Project\hsqldb-2.2.9\hsqldb\lib

Swing HSQL DB,

java -cp hsqldb.jar org.hsqldb.util.DatabaseManagerSwing --driver org.hsqldb.jdbcDriver --URL jdbc:hsqldb:hsql://localhost/xdb --user "usr" --password ""
+1

2.3.2 bin/runServer.bat ( Squirrel), :

URL: jdbc:hsqldb:hsql://localhost:9001
User: SA
Password: <blank>
0

All Articles