[SCC Practice 8] Viewing the local HSQL database in a UI
By default, Hybris runs HSQLDB in-process in file mode. The database files are in hybris/data/hsqldb/ (usually named mydb), and the running server locks them. That gives you two situations.
While the server is running: use HAC
HAC → Console → FlexibleSearch has a SQL query tab where you can run plain SQL directly against the database:
sql
SELECT * FROM tpjsearchitemtbl
This is the easiest option during development, since an external tool can’t open the files while the server holds the lock.
With the server stopped: use a database tool
Option A: HSQLDB’s built-in Database Manager. The driver jar ships with Hybris in hybris/bin/platform/lib/dbdriver/ (named something like hsqldb-2.x.x.jar):
bash
java -cp hsqldb-2.x.x.jar org.hsqldb.util.DatabaseManagerSwing
In the connection dialog, choose “HSQL Database Engine Standalone” and enter:
- URL:
jdbc:hsqldb:file:/path/to/hybris/data/hsqldb/mydb - User:
sa - Password: leave empty
Option B: DBeaver or IntelliJ’s Database tool. Create an HSQLDB (embedded) connection with the same URL and credentials. Point the driver at the jar from dbdriver/ so its version matches what Hybris uses. A mismatched version can fail to open the files or, worse, upgrade them.
To confirm the actual URL and credentials, look up db.url, db.username, and db.password in HAC → Platform → Configuration, or in your local.properties.
Close the tool before starting Hybris again, or the server won’t be able to acquire the lock. If you find yourself inspecting the database often, it’s worth switching your local setup to MySQL or PostgreSQL. You can then browse it with any client while the server runs, and it’s closer to a production setup.
