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 BadSqlGrammarException ,但是當我嘗試通過JDBCTemplate執行時會出現此錯誤。有什麼建議麼?
請嘗試閱讀javadocs。 – duffymo
仍然錯..... – duffymo