Question

I'm using Embedded database for running my test cases while maven test phase. I assume Spring must be starting the HSQLDB server. Is my assumption correct ?

<jdbc:embedded-database id="dataSource" type="HSQL"> 
    <jdbc:script location="classpath:schema.sql"/> 
    <jdbc:script location="classpath:data.sql"/> 
</jdbc:embedded-database>

How can i view the schema/table created in hsqldb using above mentioned script ? I tried connecting through DBVisulaizer but i don't see tables there.

Was it helpful?

Solution

The jdbc:embedded-database URL connects to an in-process memory database, not a server.

You need to start a server separately (a separate process) which fronts an in-memory database. You can find information on how to do this in the HSQLDB Guide.

http://www.hsqldb.org/doc/2.0/guide/listeners-chapt.html

You than use a normal connection URL such as jdbc:hsqldb:hsql://localhost/test in Spring to connect to the server. You can also connect to the server with DbVisualiser using the same URL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top