HSQLDB - which is the main database file

前端 未结 3 1205
难免孤独
难免孤独 2021-02-13 19:53

I am using HSQLDB in the embedded mode.

jdbc:hsqldb:file:abc\\\\TESTDB;

After creating the database, the folder abc has the follow

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-13 20:31

    A file containing your actual data might not exist in your folder for various reasons - particularly if you are using in-memory or non-cached tables. HSQLDB uses the various files you found in its working folder for a variety of reasons. You can read more about their purpose here: HSQLDB Reference.

    I paraphrase some of the more relevant information:

    The script file contains the definition of tables and other database objects, plus the data for non-cached tables. The log file contains recent changes to the database. The data file contains the data for cached tables and the backup file is a zipped backup of the last known consistent state of the data file. All these files are essential and should never be deleted. If the database has no cached tables, the test.data and test.backup files will not be present. In addition to those files, HSQLDB database may link to any formatted text files, such as CSV lists, anywhere on the disk.

    While the "test" database is operational, a test.log file 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. A test.lck file is also used to record the fact that the database is open. This is deleted at a normal SHUTDOWN. In some circumstances, a test.data.old is created and deleted afterwards.

提交回复
热议问题