I tried to understand the difference between PreparedStatements
& CallableStatements
and I couldn't get it. so please can anyone convert following sql
Query to CallableStatement
. I know how to convert Statement into a PreparedStatement
but having problems with CallableStatements
.
as a java.sql.Statement
SELECT * FROM Customer WHERE customerId = 'C001'
as a java.sql.PreparedStatement
SELECT * FROM Customer WHERE customerId = ? //set customerId using preparedStatement.setString(1,"C001")
How to write this same query in CallableStatements
Thanks in advance!