Database - HyperSQL DataBase (HSQLDB)

> Database

1 - About

HSQLDB is a relational database written in Java.

It is used

  • as an embedded database to avoid the requirement of having a third-party database server running separately.
  • for unit and integration testing as it offers a (volatile) in-memory storage.

HSQLDB stores data in local files

3 - Url Example

  • Memory: jdbc:hsqldb:mem:testdb;shutdown=true
  • File System: jdbc:hsqldb:file:db/name

4 - File structure

  • .script contains all the statements to create the tables, alter them and insert the data. This file is created when you use hsqldb in memory. (so I'd say this is your database) Otherwise the database is stored in .data as other people already said
  • .lck is the lock file by which hsqldb knows whether the database is used/locked by a process. This file is automatically deleted when you stop the program.
  • .log is used to write the changes made to data. This file is removed at a normal SHUTDOWN. Otherwise (with abnormal shutdown) this file is used at the next startup to redo the changes.
  • .properties contains the properties with which hsqldb is initialized
  • .data: exist after adding records to database.

5 - Note