Stored Procedure in JDBC applicationsĀ | JDBC Online Tutorials

This JDBC Online Tutorials “Stored Procedure in JDBC applications” is providing clear information about what is stored procedure, how to create, compile and run procedures from jdbc applications in java


 

Sub Programs :

  • Sub programs are called pl/sql blocks.
  • Sub programs are used to solve particular task.
  • Sub programs using DBMS syntax.
  • Sub programs execute directly in the database and returns result to java application.
  • There are two types of sub programs supported by oracle.
    1. Procedures.
    2. Functions.

 

Procedures :

  • procedures may or may not return a value
  • procedures return more than one value while using the out parameter.
  • Procedures cannot execute in select statement
  • procedure internally having one time compilation process.

 

Stored Procedure execution in Java

 

Need of Stored Procedure:

  • To avoid multiple requests to DB server for single transaction, they introduced the concept of stored procedures.
  • Stored procedure follows DBMS syntax.
  • Servlet requested data will be processed directly in Database using stored procedure.
  • Processed data will send to servlet directly.
  • Servlet directly generates resultant(dynamic) user page with processed information.

CallableStatement interface:

  • CallableStatement used to execute procedures in DBMS application.
  • We can pass input to the procedure using IN parameter
  • We can collect the output of the procedure using OUT parameters.
  • We can use number of IN and OUT parameters in a single procedure.

 

Share this