Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>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.</p> <p>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.</p> <p>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.</p> <p><strong>the links</strong></p> <ul> <li><a href="http://www.h2database.com/html/main.html" rel="nofollow noreferrer">H2</a></li> <li><a href="http://db.apache.org/derby/" rel="nofollow noreferrer">Derby</a> </li> </ul> <p>I know HSQL has in memory mode, but i haven't used it.</p> <p>Good luck.</p> <p><strong>UPDATE</strong></p> <p>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.</p> <p>The hsql seems to be a bit different in JDBC url for server memory mode </p> <p>for details refer to <a href="http://hsqldb.org/doc/guide/guide.html#N108D2" rel="nofollow noreferrer">http://hsqldb.org/doc/guide/guide.html#N108D2</a> Connections</p> <p>You have to deal with some server configs.</p> <p>@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.</p> <p><strong>"Running a memory-only HSQLDB in server mode"</strong></p> <ul> <li><p><a href="http://www.ramuenke.de/archives/34" rel="nofollow noreferrer">http://www.ramuenke.de/archives/34</a></p></li> <li><p><a href="https://stackoverflow.com/questions/1497855/how-to-run-a-hsqldb-server-in-memory-only-mode">How to run a HSQLDB server in memory-only mode</a></p></li> </ul> <p><strong>NOTE</strong> </p> <p>The second link didn't tell in detail how to connect correctly. So try the first one.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload