The callable statement interface is used to call the stored procudure in the databse. Please remember that, it is only a mechanism to execute the stored procudure but not an encapsulation of stored procudure.
A callable statement interface indicate a call to singlel stored procedure. The next thing to do is passing some parameters to the stored procedure. In case of java, java variables and constents are not passed as arguements. The actual procedure of passing aparameters is described in the next sub sections.
Since the stored procedures are database dependent, their calling methods are also database dependent. and each database has different mechanism to call stored procedures and pass parameters. While using JDBC in order to connect most database, a standard format is maintained which is to be converted to the native format by the JDBC driver.
The format is shown below
{call
where each “?” symbol represents an arguements to the procedure. Remember each parameter could be an IN,OUT and INOUT parameter.
Now, an object of callable statement to encapsulate a single call should be created, this can be done by calling the prepare call () method of connection interface. To this method CALL statement is passed as the arguements. An Example of this is shown below
Callablestatement CStmt = con.prepare(”{CALL
The callable statement interface is inherited from the prepared statement interface and hence it will have all the functions of prepared statement interface.
