Page 1 of 1

About Question enthuware.ocpjp.v7.2.1370 : Inaccurate statement about CallableStatement?

Posted: Mon Mar 18, 2013 5:37 pm
by kristwaa
In the question ([1]) about CallableStatement one of the options is:
"A CallableStatement is the only way for a Java program to execute stored procedures in the database."

Maybe that's the intention ([2]), but I'm not convinced it is true.
If the stored procedure doesn't have an output parameter you can use a PreparedStatement. If the stored procedure doesn't take any input parameters you can use a Statement - or maybe even build the call string with the parameters, which is not recommended for several reasons (security, performance, style).
Is the statement based on the API docs / specification, or on experience with a particular database system?

No big deal, but I didn't tick this option and failed the question :) What do you think?


Regards,
--
Kristian

[1] enthuware.ocpjp.v7.2.1370
[2] From the Java 7 API docs about CallableStatement: "The interface used to execute SQL stored procedures"

Re: About Question enthuware.ocpjp.v7.2.1370 : Inaccurate statement about CallableStatement?

Posted: Mon Mar 18, 2013 5:57 pm
by admin
You are right. The option has now been updated.
thank you for your feedback!