plr
plr

Reputation: 511

How to create H2 in-memory database using H2 embedded database

I'm currently writing some test cases using testng. I have a requirement to repeat same test set in H2 embedded db and in H2 in-memory db. What i want is to copy all tables and data from H2 embedded db to H2 in-memory db upon transition from one db type to another. Is it possible ? thanks in advance.

Upvotes: 0

Views: 793

Answers (1)

Ueli Hofstetter
Ueli Hofstetter

Reputation: 2534

you could use the script tool from here

http://h2database.com/javadoc/org/h2/tools/Script.html

to export the tables and data and then use runscript as descibed here

http://h2database.com/html/grammar.html#runscript

to import it in the other db

Upvotes: 1

Related Questions