Last active
September 14, 2020 09:10
-
-
Save schneefisch/465549fa05c587ce3c890b1faf95e990 to your computer and use it in GitHub Desktop.
create a new embedded H2 database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EmbeddedDatabase db = new EmbeddedDatabaseBuilder() | |
.generateUniqueName(true) | |
.setType(H2) | |
.setScriptEncoding("UTF-8") | |
.ignoreFailedDrops(true) | |
.addScript("schema.sql") | |
.addScripts("user_data.sql", "country_data.sql") | |
.build(); | |
// perform actions against the db (EmbeddedDatabase extends javax.sql.DataSource) | |
db.shutdown(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment