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 wit
You can use Derby In-memory-database and H2 in-memory-database. They are good.but H2 has a better performance. H2 has a web console GUI and Derby has eclipse plugin GUI. You can try it. I have used them in the project. H2 Database has a tag in SO and its auther will support you in SO. I think fredit is right for using server mode instead of embed mode. But his url doesn't seem to be right. At least it should use mem. For Derby, the url is jdbc:derby://myhost:1527/memory:myDB;create=true. This is the exmple url for H2 jdbc:h2:tcp://localhost/mem:db1.
You need to use server mode, so client can connect to it from network. One thing you need take care is ,in memory mode, since it's in memory, when your java process is over,the JVM is not there, the data in DB is also lost. But for testing,it becomes an advantage. You don't need to clear the test data.
H2 has a very good feature for test purpose.It has SQL support which runs compatibility SQL for IBM DB2, Apache Derby, HSQLDB, MS SQL Server, MySQL, Oracle, and PostgreSQL. Which means even you use special SQL in MS SQL Server can get the same result in H2. I believe you will like it.
the links
I know HSQL has in memory mode, but i haven't used it.
Good luck.
UPDATE
I believe if you instead write query in your test case, it will return results. I have done this a lot in my test case. Even in embed mode as long as you create your JDBC connection in your test case. If you feel this is inconvenient, you can even dump the data output to files.But you must load the data into the HSQL in your test case, you can use BeforeClass to do it.If you cannot do this,You have to use server mode.
The hsql seems to be a bit different in JDBC url for server memory mode
for details refer to http://hsqldb.org/doc/guide/guide.html#N108D2 Connections
You have to deal with some server configs.
@Rachel, I Finally find a link to help you set up server mode with in memory mode. Look at this. It's a bit complex.
"Running a memory-only HSQLDB in server mode"
http://www.ramuenke.de/archives/34
How to run a HSQLDB server in memory-only mode
NOTE
The second link didn't tell in detail how to connect correctly. So try the first one.