例外
Exception in thread "main" org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [\. D:\Documents\workspace-sts-3.0.0.RELEASE\groupbased\src\test\resources\stress\storedProcedures.sql]; nested exception is 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 '\. D:\Documents\workspace-sts-3.0.0.RELEASE\groupbased\src\test\resources\stress' at line 1
Java 代码
template.execute("USE example_db;");
template.execute("\\. D:\\Documents\\workspace-sts-3.0.0.RELEASE\\groupbased\\src\\test\\resources\\stress\\storedProcedures.sql");
(模板是一个 JDBCTemplate)
我可以通过 mysql 控制台很好地运行该命令,但是每当我尝试通过 JDBCTemplate 执行时都会收到此错误。有什么建议么?