databasehsqldbin-memory-databasedatabase-tools

Concept of In Memory Database and how to see if my data is being populated in HSQL DB?


I am using HSQL in memory database for test purpose of my application and using SQL Server as main database, now when am doing test then HSQL Database is being populated with same data that I have in my SQL Server, now I am trying to test particular service which is retrieving data from Database(it would query MS Server if directly service is run or it will query HSQL Database if called from test)

I am able to see data from MS Server when I run the query but HSQL Db does not return any data if am running same query on it. My hunch here is that HSQL DB is not being populated with the data, is there a way where in I can go and look in what tables I have in HSQL DB and how data is being populated in HSQLDB, i want to see data and i do not have any gui client to see how HSQL Database is populated and what data goes in what table. Do we have a good client for the same and how can I connect to HSQL Database using it and also how can I actually see things happening under HSQL Cover rather than just assuming that HSQL is being populated properly with what we have in SQL Server?

Any suggestions would go long way?


Solution

  • Here I add a detailed steps of

    How To Running a memory-only HSQLDB in server mode?

    1) Download the latest version hsqldb-2.2.5.zip

    2) unzip it,open the bin folder

    3) modify the runServer.bat like cd ..\data @java -classpath ../lib/hsqldb.jar org.hsqldb.server.Server -database.0 mem:aname -dbname.0 aliasdb and click the runServer.bat to start server

    4) run the runManager.bat, select Server type, enter the url jdbc:hsqldb:hsql://localhost/aliasdb,connect, create some test table and test data

    5) run the runManager.bat again to start another client,select Server type, enter the url jdbc:hsqldb:hsql://localhost/aliasdb, connect, you will find the data you created.