【发布时间】:2020-01-14 21:42:45
【问题描述】:
当我运行这段代码时
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(?)从mysql客户端调用相同的过程时,它可以工作,我已经搜索过,看起来我错过了一些东西。
顺便说一下输出
136 - DDL is : sql : 'CALL testdb.test_procedure(?)', parameters : ['123456']
【问题讨论】:
标签: mysql scala stored-procedures jdbc