HSQLInspect

Étiquettes: hsql hsqldb

This page describes a simple way to inspect the in-memory HSQL database that is used in the default Liferay bundles. You should stop the application server that's accessing the database before inspecting / modifying it with the procedure below.

Obtain HSQL JDBC Driver #

The HSQLDB JDBC driver is bundled in the main HSQL JAR. Download the HSQL distribution. In the lib directory you should find hsql.jar. Make a note of the location.

Obtain SquirrelSQL #

SquirrelSQL is an open-source database explorer that supports any JDBC accessible database.

Configure the HSQL Driver #

In the "drivers" pane in SquirrelSQL, you should see "HSQLDB In-Memory". It will have a red X in front of it meaning that you have not yet configured the JDBC driver location. Edit this driver (the pen icon). In the opened window, click the "extra class path" tab. Click "add" and navigate to hsqldb.jar from the HSQL distribution. The "class name" field below should now be filled in with "org.hsqldb.jdbcDriver".

Create an Alias #

An alias is a pre-configured connection to a particular database. In the alias pane, click new (the + icon). The URL should be of the form jdbc:hsqldb:file:<path>/lportal, where <path> is the current working directory of the application server, which is usually the directory where you executed the application server's start command. Look for lportal.script, lportal.log, etc. to validate that you have the correct path.

For example: jdbc:hsqldb:file:/Users/jtb/glassfish/lportal

The user name should be "sa", and the password "" (blank).

Connect #

Make the connection by double-clicking on the alias. Liferay's tables are under PUBLIC/TABLES.

Moyenne (3 Voter)
L'estimation moyenne est de 4.33333333333333 étoiles sur 5.
Commentaires
Réponses Auteur Données
Perfect article! :D Brian Preuß 9 septembre 2008 04:10
Awesome! Thank you Andreas Minnich 12 novembre 2008 06:30
adsf Ramdas Sawant 8 décembre 2008 22:30
Dot even need SquirrelSQL. Use hsqldb builtin... Ramdas Sawant 8 décembre 2008 22:32
Can you please detail "Create an Alias" part...... ilke Muhtaroglu 1 juillet 2010 05:38
The information helped a lot. Ricardo Kehrle Miranda 5 juillet 2010 12:40
It failed in the connection to the data base.... Tom I. 16 novembre 2010 03:28
Try this: 1. Shutdown your liferay server; 2.... Henrique Fernandes 13 décembre 2010 06:47
Hi, I tried to configure the liferay HSQLDB as... Fatema Rajkotwala 16 février 2012 19:13
Make sure that the server is stopped while... Huage Chen 18 juin 2013 07:35
Hi, I get an error when trying to connect:... David Lee 5 février 2014 15:18
If you are having trouble seeing the Liferay... David Benson 10 juin 2014 01:56
Thanks, this worked for me. Christian Wilkie 10 juillet 2014 12:22

Publié le 09/09/08 04:10.
Publié le 12/11/08 06:30.
Publié le 08/12/08 22:30.
Dot even need SquirrelSQL. Use hsqldb builtin db explorer

java -cp <path of hsqldb.jar> org.hsqldb.util.DatabaseManager

Go ahead with "Create an Alias" step described above

Cheers !!!!!
Publié le 08/12/08 22:32 en réponse à Ramdas Sawant.
Can you please detail "Create an Alias" part...

in Configure the HSQL Driver, it is told that we should provide the hsql.jar (this already exists in /lib/ext of liferay tomcat distribution, ok?)

then we are told to provide an url, which is in form "jdbc:hsqldb:."

there it is told url should be "jdbc:hsqldb:file:<path>/lportal"

( according to this link: http://www.emforge.net/web/liferay-petstore-portlet/wiki/-/wiki/Main/Step1:+From­+DB+to+simple+UI )

( according to this link: http://www.liferay.com/community/forums/-/message_boards/message/70471 )

so what I try is to give URL:

jdbc:hsqldb:file:/home/ilke/lportal6/liferay-apache-tomcat-6.0.26/bin/lporta­l


Then I get the following error by SQuirreL:

( liferay_hsql: The database is already in use by another process: lockFile: org.hsqldb.persist.LockFile@b82b963b[file =/home/ilke/lportal6/liferay-apache-tomcat-6.0.26/bin/lportal.lck, exists=true, locked=false, valid=false, ] method: checkHeartbeat read: 2010-07-01 15:35:24.417 heartbeat - read: -9854 ms.
)


I use Ubuntu, liferay deployed into tomcat.

ilke
Publié le 01/07/10 05:38.
The information helped a lot.
Publié le 05/07/10 12:40.
It failed in the connection to the data base.
The database is already in use by another process: lockFile: org.hsqldb.persist.LockFile@aadfcab9

Is there a way to inspect HSQL data during debug in Eclipse?
Publié le 16/11/10 03:28.
Try this:

1. Shutdown your liferay server;
2. Edit [LIFERAY_HOME]\data\hsql\lportal.properties
3. Set hsqldb.lock_file=false
Publié le 13/12/10 06:47 en réponse à Tamas Imrei.
Hi,
I tried to configure the liferay HSQLDB as mentioned in the above article.
I gave the URL as jdbc:hsqldb:fileemoticon:/<Liferay_HOME>/data/hsql/Iportal
I am not getting any errors and when I am testing the Squirrel connection it is showing as Connection successful.
But still I am not able to view the liferay tables.Is there something more that needs to be configured.Please help me out.
Publié le 16/02/12 19:13.
Make sure that the server is stopped while access the HSQLDB
Publié le 18/06/13 07:35 en réponse à Fatema Rajkotwala.
Hi,
I get an error when trying to connect:
Caused by: java.sql.SQLException: Unable to create connection. Check your URL.
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.getConnection(SQLDriverMana­ger.java:136)
at net.sourceforge.squirrel_sql.client.mainframe.action.OpenConnectionCommand.execu­teConnect(OpenConnectionCommand.java:167)
... 8 more

I am running Windows. So my URL is:
jdbc:hsqldb:file:c:/liferay/data/hsql/lportal

Is this correct? Please help. Thanks in advance!!
Publié le 05/02/14 15:18.
If you are having trouble seeing the Liferay tables, try changing the alias path to jdbc:hsqldb:file:/<liferay location>/data/hsql/lportal

This worked for me. Thanks to this post for pointing me in the right direction:
http://btnkumar.blogspot.co.uk/2011/11/how-to-open-hsql-db-tables-of-l­iferay_29.html
Publié le 10/06/14 01:56.
Thanks, this worked for me.
Publié le 10/07/14 12:22 en réponse à David Benson.