The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

dakbari (34) [Avatar] Offline
#1
Hi Chris,



I use the framework component HSQDB 1.7.2 as you recommend.



Using Chapter 6's JUnit Test class from your sample code in Eclipse
Chapter06HibernateDomainAllTests.java
all runs fine but I can't view the Schema of FTGO (Food To Go).



I start the HSQLDB Viewer with:



java -cp %CLASSPATH% org.hsqldb.util.DatabaseManagerSwing




where CLASSPATH contains Dsmilierogrammehsqldblibhsqldb.jar



Here are the settings I use:





But where is the schema???

ceracm (113) [Avatar] Offline
#2
Re: Using HSQLDB In-Memory Database but can't view Schema
The *in-memory* database is exactly that - once the JVM running the tests exits the schema ceases to exist.

If you want to view the schema you could, for example:
1. Run HSQLDB in server mode
2. Change the DataSource bean definition to use this JDBC URL: jdbc:hsqldb:hsql://<hostname>/<dbName>

This would let you use tools such as the viewer to see the DB.

See the HSQLDB docs for the details.

I hope this helps.

Chris
dakbari (34) [Avatar] Offline
#3
Re: Using HSQLDB In-Memory Database but can't view Schema
Following your advise I run the server after having changed the DataSource bean url to:

jdbc:hsqldb:hsql://localhost/testdb

and start the server as following:

java -cp %CLASSPATH% org.hsqldb.Server -database.0 ftgo -dbname.0 testdb


But running your Ch 6 JUnit Test and the viewer I still miss to view the schema :_|

Have you tried the server scenario ?smilie

Regards,
Darya
ceracm (113) [Avatar] Offline
#4
Re: Using HSQLDB In-Memory Database but can't view Schema
I just did and it worked just fine for me.

Make sure both the DataSource and the Viewer are pointing at jdbc:hsqldb:hsql://localhost/testdb

Chris
dakbari (34) [Avatar] Offline
#5
Re: Using HSQLDB In-Memory Database but can't view Schema
Hi Chris,



I could swear that I did everything right yesterday, however with no success. Today I did the same and it works :0 smilie



See the screenshot for the connection settings and the test scenario as described at the begin of this thread:







The test scenario all in one screen smilie :







Thanks,



Darya
ceracm (113) [Avatar] Offline
#6
Re: Using HSQLDB In-Memory Database but can't view Schema
Nice screen shot.

I'm glad that you got it to work.

Chris