Is "prepared-statement" a stored procedure? From this link it appears not to be. Comparison with prepared statements From this link it appears to be. JDBC introduction
(ctrl+f stored procedure to find the bit related to stored procedure in the second link)
In the latter link the code example they show in that official oracle web page, is a prepared statement, not a callable statement as I thought it would correspond to a stored procedure.
You are right, the code referenced in that tutorial does not call a stored procedure. The intention is to convey that this is a stored procedure written in Java:
(emphasis mine)
For example Oracle supports Java stored procedures, the example in the tutorial is how you would implement that stored procedure using Java. In my opinion it is highly confusing because it is not how you call a stored procedure from Java, and this should not have been part of the JDBC tutorial in this form.
To be clear: A
PreparedStatement
itself is not a stored procedure, but it can be used to call (execute) a stored procedure (the same applies toStatement
), aCallableStatement
just has more features that are suitable for executing stored procedures.In the tutorial the Java stored procedure uses a
PreparedStatement
to execute a query as part of the execution of that Java stored procedure. It is unfortunate that this tutorial clouds the issue by discussing this advanced subject without talking about the normal task of executing stored procedures.