Unsuccessful: alter table XXX drop constraint YYY in Hibernate/JPA/HSQLDB standalone

You can ignore these errors. Combination of create-drop and empty (which is the case always for in-memory) database produces these for every database object it tries to drop. Reason being that there is not any database objects to remove – DROP statements are executed against empty database. Also with normal permanent database such a errors … 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

How to see all the tables in an HSQLDB database?

The ANSI SQL92 standard for querying database metadata is contained within the INFORMATION_SCHEMA data structures. I have no idea whether your database supports this or not, but try the following: SELECT * FROM INFORMATION_SCHEMA.TABLES On further research, it appears that HSQLDB does support INFORMATION_SCHEMA, but with slightly non-standard naming. All of the tables have SYSTEM_* … Read more

is there a standard way to define a JDBC Datasource for Java EE containers?

Is there a standard way to define a JDBC datasource and deploy it? Yes, there is. It’s done via the <data-source> element, which you can put in web.xml, ejb-jar.xml and application.xml. If you don’t like XML, you can also use an annotation for this instead: @DataSourceDefinition Example of a web.xml entry <data-source> <name>java:app/myDS</name> <class-name>org.postgresql.xa.PGXADataSource</class-name> <server-name>pg.myserver.com</server-name> … Read more