Execute SQL file from Spring JDBC Template

后端 未结 4 920
我在风中等你
我在风中等你 2021-02-05 06:44

I\'m trying to write a bit of code that reads a SQL file (multiple CREATE TABLE statements separated by ;) and executes all the statements.

In

4条回答
  •  时光说笑
    2021-02-05 07:36

    Maybe Spring's ScriptUtils will be useful in your case. Especially executeSqlScript methods.

    Note that DEFAULT_STATEMENT_SEPARATOR has a default value of ';' (see Constant Field Values)

提交回复
热议问题