CallableStatement interface in JDBC | JDBC Java Tutorials

This JDBC Java Tutorials “CallableStatement interface” post is providing information about what is callable interface and use of callable statement interface in JDBC applications.


Callable statement

  • PreparedStatement is the Child class of Statement interface
  • CallableStatement is the Child class of PreparedStatement interface
  • Used to execute stored procedures from Java application.


How to collect CallableStatement Object :


Executing Proceducre process :

  • The JDBC API provides a stored procedure SQL escape syntax.
  • Stored procedure syntax is a standard way for all RDBMSs.
  • Parameters can be passed while calling a stored procedure.
  • We can collect the output of procedure based on the requirement.

{? = call <procedure-name> [<arg1>,<arg2>, …] }
{call <procedure-name> [<arg1>, <arg2>, …] }

  • IN parameters can be set using setter methods. These methods inherited from PreparedStatement.
  • OUT parameters must be registered prior to executing the stored procedure.
  • OUT parameter values are retrieved after execution using getter methods.
Share this