Running multiple SQL statements from Groovy

后端 未结 3 651
遇见更好的自我
遇见更好的自我 2021-01-13 00:17

I\'m having problems running multiple SQL statements in one activaction from Groovy.

sql = Sql.newInstance(\"jdbc:mysql://localhost/\", \"usre\", \"pass\", \         


        
3条回答
  •  梦毁少年i
    2021-01-13 01:08

    You can simply augment the following jdbc url parameter to your connection string

    http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html#allowMultiQueries

    From the docs:

    Allow the use of ';' to delimit multiple queries during one statement (true/false), defaults to 'false'

    For example:

    Sql.newInstance("jdbc:mysql://localhost?allowMultiQueries=true", "usre", "pass", "com.mysql.jdbc.Driver")
    

提交回复
热议问题