tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Gallimore <>
Subject Re: How to examine database when testing entity beans?
Date Tue, 26 May 2009 19:49:23 GMT
Hi Siegfried,

This test uses a HSQLDB in-memory database running embedded in the JVM, so
(as far as I'm aware) you can't connect to it with a client.

You could however, run an instance of HSQLDB as a server, and you can hook
up SQuirreL to that:

You can run the server from the console by running:

java -cp lib/hsqldb- org.hsqldb.Server -database.0 file:movies
-dbname.0 movies

And then change the properties at the top of the test to look like this:

        Properties p = new Properties();
        p.put("movieDatabase", "new://Resource?type=DataSource");
        p.put("movieDatabase.JdbcDriver", "org.hsqldb.jdbcDriver");

        p.put("movieDatabaseUnmanaged", "new://Resource?type=DataSource");
        p.put("movieDatabaseUnmanaged.JdbcDriver", "org.hsqldb.jdbcDriver");
        p.put("movieDatabaseUnmanaged.JtaManaged", "false");

You'll then be able to connect to the database using this JDBC URL:

Hope that helps.


On Tue, May 26, 2009 at 9:07 AM, siegfried <> wrote:

> I'm studying
> c:\dev\sandboxes\EJB\openejb\examples\apache\openejb-examples-3.1\simple-cmp
> 2\src\test\java\org\superbiz\cmp2\
> Who is cleaning up the database? I thought it was using dbunit was doing it
> but I see is deleting it. Hmmmm.... Could this example have
> been done more efficiently with dbunit?
> How can I pause the execution of the test so I can see the data in the HSQL
> database using a client like squirrel to look at the data?
> Thanks,
> Siegfried

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message