Mybatis批量更新

	
		
		update 表名 set last_updater_time = now()
		where id =#{param.id}
		
    

但Mybatis映射文件中的sql语句默认是不支持以" ; " 结尾的,也就是不支持多条sql语句的执行。所以需要在连接mysql的url上加 &allowMultiQueries=true 这个才可以执行,需要在jdbc的url中指定allowMultiQueries=true

spring.datasource.url=jdbc:mysql://localhost:3306/test?allowMultiQueries=true

你可能感兴趣的:(mybatis,java,服务器)