Java-JDBCアプリケーションの統合テスト用のインメモリデータベースとしてHyperSQLを使用したいと思います。
私が以下を試してみると:
Properties props = new Properties();
props.put("user", "sa");
props.put("password", "");
Class.forName("org.hsqldb.jdbcDriver");
Connection cn = DriverManager.getConnection("jdbc:hsqldb:mem://localhost", props);
Statement st = cn.createStatement();
st.executeUpdate("Insert into foo (bar) values (10);");
私は得る:
java.sql.SQLException: Table not found: foo in statement [Insert into bar]
インメモリデータベースとして使用するときにHSQLがテーブルを動的に生成する方法があると思いましたが、ドキュメントでそれを見つけることができないようです。