After you have written the Java code for the stored procedure, you need to create the stored procedure in your Java DB database. Use the following command to create the give_raise stored procedure:

--Command to create a stored procedureCREATE PROCEDURE give_raise(IN person_id integer, IN raise double, OUT old_income Double, OUT new_income Double)PARAMETER STYLE JAVALANGUAGE JAVAMODIFIES SQL DATAEXTERNAL NAME 'com.jdojo.jdbc.JavaDBGiveRaiseSp.giveRaise';

You can execute the command using the ij command-line tool or NetBeans IDE. Please refer to the “A Brief Overview of Java DB” section earlier in this chapter for more details on how to execute SQL commands in Java DB.

To get the give_raise stored procedure working in Java DB, you need to install ...

Get Beginning Java 8 APIs, Extensions and Libraries Swing, JavaFX, JavaScript, JDBC and Network Programming APIs now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.