Which is better H2 or HSQLDB? [closed]

Please note I had provided this answer in 2011. It may be outdated My company develops a database abstraction library (jOOQ), which supports both databases. Our integration tests cover a lot of functionality, including the calling of stored procedures and functions, arrays, nested selects, etc. I experience HSQLDB 2.1 to be slightly faster than H2 … Read more

View content of H2 or HSQLDB in-memory database

You can run H2 web server within your application that will access the same in-memory database. You can also access the H2 running in server mode using any generic JDBC client like SquirrelSQL. UPDATE: Server webServer = Server.createWebServer(“-web,-webAllowOthers,true,-webPort,8082”).start(); Server server = Server.createTcpServer(“-tcp,-tcpAllowOthers,true,-tcpPort,9092”).start(); Now you can connect to your database via jdbc:h2:mem:foo_db URL within the same … Read more

Frontend tool to manage H2 database [closed]

I like SQuirreL SQL Client, and NetBeans is very useful; but more often, I just fire up the built-in org.h2.tools.Server and browse port 8082: $ java -cp /opt/h2/bin/h2.jar org.h2.tools.Server -help Starts the H2 Console (web-) server, TCP, and PG server. Usage: java org.h2.tools.Server When running without options, -tcp, -web, -browser and -pg are started. Options … Read more

Can I have H2 autocreate a schema in an in-memory database?

Yes, H2 supports executing SQL statements when connecting. You could run a script, or just a statement or two: String url = “jdbc:h2:mem:test;” + “INIT=CREATE SCHEMA IF NOT EXISTS TEST” String url = “jdbc:h2:mem:test;” + “INIT=CREATE SCHEMA IF NOT EXISTS TEST\\;” + “SET SCHEMA TEST”; String url = “jdbc:h2:mem;” + “INIT=RUNSCRIPT FROM ‘~/create.sql’\\;” + “RUNSCRIPT … Read more

H2 in-memory database. Table not found

DB_CLOSE_DELAY=-1 hbm2ddl closes the connection after creating the table, so h2 discards it. If you have your connection-url configured like this jdbc:h2:mem:test the content of the database is lost at the moment the last connection is closed. If you want to keep your content you have to configure the url like this jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 If doing … Read more