I'm assuming you have correctly installed hsql via "sudo yum install"
As hsql is installed without a password by default, the first thing you need to do is set the password for the db.
- Navigate to the hsql installed directory "cd /var/lib/hsqldb"
- Start the db using "sudo java -cp lib/hsqldb.jar org.hsqldb.Server - database.0 file:data/db0 -dbname.0 firstdb &" This will start the database with an alias of "firstdb" and create the files under the "data" directory.
- The next step use the command line sql tool to access the db.
- Copy the "sqltool.rc" file from the hsqldb directory to the user's home directory "cp /var/lib/hsqldb/sqltool.rc ~/sqltool.rc"
- Execute the following command to start the tool : "java -jar /var/lib/hsqldb/lib/hsqldb.jar db0-url" This will provide an "sql>" prompt.
- Now set the password "sql> set PASSWORD password;" (syntax may not be 100% correct)
- Now shutdown the database "sql> shutdown;"
- Quit the sqltool "sql> \q"
- At this stage the hsqldb should have been shutdown correctly with the new password configured. Restart the hsql database as before in step 1 and 2.
- To check that the password has been changed, try accessing the database with the sqltool again from step 5. It should fail to connect.
- From the home directory, edit sqltool.rc to change the password used to access the database. "vi sqltool.rc"
- Find the urlid db0-url that represents your db. It has 4 properties: urlid, url, username and password. The value for password is probably empty so change that to "password". Save and exit vi.
- Now try accessing the database again from step 5. It should connect successfully.