简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM