|
When passing two statements the MySQL driver complains:
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO User VALUES(UUID(),NOW(),
Here are the two SQL statements:
<sqlCommand>DELETE FROM User WHERE username="$
{mysql.user}";INSERT INTO User VALUES(UUID(),NOW(),"${mysql.user}
@mms_dresden.de","$
{mysql.user}","MMS","9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","${mysql.user}
")</sqlCommand>
Executing each SQL command on its own is working.
Here is the complete plugin configuration:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.5</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
</dependencies>
<configuration>
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://$
{mysql.server}
:$
{mysql.port}
/$
{mysql.database}
</url>
<username>$
{mysql.user}</username>
<password>${mysql.password}</password>
<delimiter>;</delimiter>
<sqlCommand>DELETE FROM User WHERE username="${mysql.user}
";INSERT INTO User VALUES(UUID(),NOW(),"$
{mysql.user}@mms_dresden.de","${mysql.user}
","MMS","9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08","$
{mysql.user}
")</sqlCommand>
</configuration>
</plugin>
|