From Java we’d do something like:
stmt.execute("SELECT * FROM users");
But for a stored procedure like:
stmt.execute("{CALL createUser(?,?,?,?)}");
Why do we need the { and } when this is not required in normal SQL?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The curly braces are the escape syntax for stored procedures. When the JDBC driver encounters
{call createUser(?,?,?,?)}, it will translate this escape syntax into the native SQL used by the database to call the stored procedure.