December 2010
Intermediate to advanced
451 pages
11h 16m
English
You are writing a Java application that uses JDBC to access data, but you also want to call some PL/SQL stored procedures from within your Java application.
Use the JDBC API to connect to the database, and then execute prepareCall(), passing a string to it that consists of a PL/SQL code block that calls the stored procedure. For example, consider a stand-alone Java class that contains a method named increaseWage(). This method uses JDBC to obtain a database connection, create a CallableStatement, and then invoke the PL/SQL stored procedure that passes in the required variables.
import java.sql.*;
import oracle.jdbc.*;
public class EmployeeFacade {
public void increaseWage() ...Read now
Unlock full access