我试图理解 PreparedStatements
和 CallableStatements
之间的区别,但我无法理解。所以请任何人都可以将以下 sql
查询转换为 CallableStatement
。我知道如何将 Statement 转换为 PreparedStatement
但在使用 CallableStatements
时遇到问题。
作为 java.sql.Statement
SELECT * FROM Customer WHERE customerId = 'C001'
作为 java.sql.PreparedStatement
SELECT * FROM Customer WHERE customerId = ? //set customerId using preparedStatement.setString(1,"C001")
如何在 CallableStatements
中编写相同的查询
提前致谢!
最佳答案
关于java - PreparedStatements 或 callableStatements,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15602407/