O'Reilly logo

Oracle and PL/SQL Recipes: A Problem-Solution Approach by Matt Arena, Josh Juneau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

15-10. Passing Data Objects from PL/SQL to Java

Problem

You have retrieved a row of data from the database using PL/SQL, and you want to populate a PL/SQL object type with that data and then pass the populated data object to a Java procedure.

Solution

Create a PL/SQL object type, along with a call specification for the Java stored procedure that you want to pass the object to. Ensure that the Java stored procedure accepts an object of type oracle.sql.STRUCT and that the call specification accepts the PL/SQL object type you have created. For this recipe, the example will demonstrate the creation of a Java method that will accept an Employee object and return that employee's corresponding department name. The Java code will be invoked from within ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required