Reset Embedded H2 database periodically

前端 未结 6 1024
青春惊慌失措
青春惊慌失措 2021-02-01 13:17

I\'m setting up a new version of my application in a demo server and would love to find a way of resetting the database daily. I guess I can always have a cron job executing dro

6条回答
  •  逝去的感伤
    2021-02-01 13:42

    The command: SHUTDOWN
    You can execute it using RunScript.execute(jdbc_url, user, password, "classpath:shutdown.sql", "UTF8", false);
    I do run it every time when the Suite of tests is finished using @AfterClass

提交回复
热议问题