1

In MySQL Connector/J 5.1.39 there was com.mysql.jdbc.jdbc2.optional.MysqlDataSource.setAllowMultiQueries() to allow multiple statements in SQL queries.

In new version 6.0.4 MysqlDataSource is moved to com.mysql.cj.jdbc.MysqlDataSource and there is no setAllowMultiQueries method.

How can I enable execution of multi-statement queries?

UPDATE

This question is not duplicate of Multiple queries executed in java in single statement.

I know that I can specify allowMultiQueries in JDBC url by calling MysqlDataSource.setUrl() but I use various MysqlDataSource.set* methods to set server, port, etc. In previous version there was same method for allowing multi-queries. I want to understand why it's gone.

Community
  • 1
  • 1
mixel
  • 25,177
  • 13
  • 126
  • 165
  • The [6.x Developer Guide](https://dev.mysql.com/doc/connector-j/6.0/en/connector-j-reference-configuration-properties.html) still lists `allowMultiQueries` as a valid parameter for the connection URL, so it should be in there *somewhere*.... – Gord Thompson Sep 24 '16 at 21:53
  • 2
    The answer is in the connection string. The answer to why it is gone is in someone's head in a development team and Primary Opinion based. Your question was: *How can I enable execution of multi-statement queries?* ... and to that there is a duplicate question (several) and answers on them – Drew Sep 24 '16 at 23:18

0 Answers0