Path for DML and DDL script in jdbc url when connecting to H2 database

20 views
Skip to first unread message

denis yak

unread,
Jul 11, 2021, 11:01:03 AM7/11/21
to H2 Database

i've read in H2 tutorial that i can execute DDL or DML commands automatically when a client connects to a databas by this way:

String url = "jdbc:h2:mem:test;INIT=runscript from '~/create.sql'\\;runscript from '~/init.sql'";

but i can't understand how should i specify my path instead '~/create.sql'considering that i use maven sructure in my project and my sql script is located in the

\src\test\resources\creationTables.sql
Reply all
Reply to author
Forward
0 new messages