Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6018949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:20:56+00:00 2026-05-23T03:20:56+00:00

I am looking into HSQL (to embed in an app) and was expecting that

  • 0

I am looking into HSQL (to embed in an app) and was expecting that the data would be saved in a myDB.data file in the filesystem
Instead after a clean shutdown (execute sql “shutdown”, stop and shutdown server object) the only remaining files are myDB.properties and myDB.script and myDB.script has all the commands to recreate the data in memory. No myDB.data file exists
E.g. from myDB.script

CREATE MEMORY TABLE PUBLIC.DUMMYTABLE(ID INTEGER PRIMARY KEY,FIRSTNAME VARCHAR(20))

From myDB.properties:

version=2.2.4
modified=no

I thought I was using file db and not memory db.

Class.forName("org.hsqldb.jdbc.JDBCDriver");

HsqlProperties p = new HsqlProperties();  
p.setProperty("server.database.0", "file:./testDB");  
p.setProperty("server.dbname.0","myDB");  
p.setProperty("server.address","localhost");  
Server server = new Server(); server.setProperties(p);  
server.start();  
Connection connection = DriverManager.getConnection"jdbc:hsqldb:hsql://localhost:9001/myDB", "SA", "");    
PreparedStatement st = connection.prepareStatement("CREATE TABLE dummyTable (id INTEGER PRIMARY KEY, firstname VARCHAR(20))");    
st.executeUpdate();   
connection.prepareStatement("shutdown").execute();  
connection.close();  
server.stop();  
server.shutdown();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:20:56+00:00Added an answer on May 23, 2026 at 3:20 am

    If you use a file: database, HSQLDB should create .script and .properties (and possibly a .log if there is an unexpected shutdown) for your database, and these files will not be removed if the application is shut down. The .script file should have all of the INSERT statements necessary to repopulate your data.

    If you use a mem: database, the files will not be written at all, and the data will not be saved between instances. From the guide:

    As no information is written to disk,
    this mode should be used only for
    internal processing of application
    data, in applets or certain special
    applications. This mode is specified
    by the mem: protocol.

    The fact that the files exist and remain between application restarts is, in itself, the “file” database that you’re looking for.

    Edit:

    To answer your comment,

    But in which case is the *.data file used that the manual mentions

    From the guide:

    This file contains the (binary) data records for CACHED tables only.

    See horse’s answer for information about CACHED vs MEMORY tables. Regarding your questions about when you’d use CACHED tables, here’s another snippet from the guide:

    Only part of their data or indexes is
    held in memory, allowing large tables
    that would otherwise take up to
    several hundred megabytes of memory.
    Another advantage of cached tables is
    that the database engine takes less
    time to start up when a cached table
    is used for large amounts of data. The
    disadvantage of cached tables is a
    reduction in speed. Do not use cached
    tables if your data set is relatively
    small. In an application with some
    small tables and some large ones, it
    is better to use the default, MEMORY
    mode for the small tables.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're looking into using CouchDB/CouchCocoa to replicate data to our mobile app. Our system
I am looking into a web app that already uses Quartz. In the web.xml
By looking into the Open JPA website i've found that i can log the
Am looking into developing an iPhone native app using Titanium Developer Since this is
I'm looking into using Visual Studio 2008's built in unit test projects instead of
Looking into the documentation it says that the Rollback method can throw when the
Looking into possibility of making an USB distributed application that will autostart on insertion
Looking into installing an instance of SQL Express for an app. I want to
I'm currently looking into automating a flex build so that we can get it
I am looking into Renderscript capabilities and stuck with the A3D (Android 3d) file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.