HSQL and Memory Database

The quest continues on HSQL.

Creating a new database was a snap. Simply obtained a connection by passing in the jdbc string appending the filename at the end. The database files was created related to the "working directory". (ie, jdbc:hsqldb:file:db)

I wrote the database table schema in SQL. The SQL syntax was pretty standard. It was also nice that they support IDENTITY for a field for primary on sequence.

The doc explains clearly how to use its SQL tools interactively or non-inteactively. Tables were created without any problem. Restarting the non-inteactive sqltool still saw the tables I created.

However, when it came to the next steps: making samples, the behaviour was unexpected. The row that inserted disappeared after restarted. The table was created as "MEMORY" type by default. After reading the doc, it should be fine. The whole data set was kept in memory, but unlike TEMP type, the data was persisted and reconstructed when the database is restarted. However, launching the sqltool again and I find no row with select all. Twisting the table to CACHED or TEXT type didn't help. After a couple of hours, I still didn't get further.

Ok, tight schedule, the next inline would be Derby from Apache.

Tag: , ,