当我运行此代码时
conn = connPool.getDBConnection
val id: String = "123456"
val query: String = "CALL testdb.test_procedure(?)"
stmt = conn.prepareStatement(query)
stmt.setString(1, id)
logger.info("DDL is : " + stmt.toString)
val result = stmt.executeUpdate(query)
我明白了
java.sql.SQLException: 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 '?)' at line 1
当我使用
CALL testdb.test_procedure(?)
我搜过了,好像丢了什么东西。
顺便说一下,输出是
136 - DDL is : sql : 'CALL testdb.test_procedure(?)', parameters : ['123456']