4

Is there a way that I can specify a script in the connection string pointing to my in memory hsqldb instance?

I was looking at this article and it looks like it is possible, but I'm not sure how to formulate the string correctly or where to put the script file. Looking at the hsqldb documentation here it doesn't appear to be the case.

What would my options here be for using this from java tests?

This is related to a previous hsqldb question here starting and stopping hsqldb from unit tests

2
  • 1
    Do you use Hibernate and SchemaExport? If yes, then you can put an import.sql on the runtime classpath and Hibernate will load it. Commented Jun 11, 2010 at 18:52
  • I have not used SchemaExport. I exported some data out of another databased and created a script, but it doesn't appear that hibernate is seeing my script anywhere. Commented Jun 11, 2010 at 18:55

1 Answer 1

1

Use a file: database instead of mem:, but include "files_readonly=true" in the properties file. Changes to the database during tests will not be persisted.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.