As you can imagine,
CREATE TABLE table1(id int);
CREATE TABLE table2(id int);
is easy executable on MySQL and on nearly every other SQL-Database.
This
<update id="test">
CREATE TABLE table1(id int);
CREATE TABLE table2(id int);
</update>
is executable on MS SQL Server, but not on a MySQL-Database. Error:
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: 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 'CREATE TABLE table2(id int)' at line 2
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: CREATE TABLE table1(id int); CREATE TABLE table2(id int);
Any ideas, why this is the case?
EDIT:
<update id="test">
CREATE TABLE table(id int);
</update>
.. is working everywhere.
EDIT for clarification: My complete mybatis mapper.xml.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="InitializationMapper">
<update id="test">
CREATE TABLE table1(id int);
CREATE TABLE table2(id int);
</update>
</mapper>