我试图理解PreparedStatements和CallableStatements之间的区别,但我无法理解。所以请任何人都可以将以下sql查询转换为CallableStatement。我知道如何将语句转换为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中编写相同的查询
提前感谢!
发布于 2013-03-25 02:39:59
看看这个
DIfference Between Stored Procedures and Prepared Statements..?
主要用于StoredProcedure的CallableStatement
https://stackoverflow.com/questions/15602407
复制相似问题