当需要同时插入多条sql或一个sql中通过分号分割(或包含)了多个独立sql的话,如:
select 'hello';select 'world'
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax
默认allowMultiQueries为false就会报上述错误,当若显式设置allowMultiQueries为true,如:
String url = "jdbc:mysql://localhost:3306?allowMultiQueries=true"
可以同时插入多条sql语句