1

I am trying to execute some sql script using

property name="url" value="someurl;INIT=RUNSCRIPT FROM 'mytestscript.sql';

I am not sure -

  1. Sql script file loaded or not, Since these configuration has been done for Junit using H2 database i can't run query to verify the same in database
userbitu
  • 13
  • 2

1 Answers1

0

If you're sure that connection URL is used by your test system as is and the same database is not already open without such INIT parameter, you can be sure that script will be executed completely without any errors, H2 does not open a connection if INIT wasn't completed normally, an SQLException will be thrown on connection attempt.

Evgenij Ryazanov
  • 6,960
  • 2
  • 10
  • 18
  • Thanks @Evgenij. This https://stackoverflow.com/questions/4490138/problem-with-init-runscript-and-relative-paths worked for me. I had my script in different directory than resources. – userbitu Oct 30 '19 at 11:41