If you develop a Java™ application
that accesses a database by using pureQuery™,
SQLJ, or JDBC, you can create Java stored
procedures from methods in the Java project.
Before you begin
Before you can create Java stored
procedures from methods in Java projects,
you must configure the necessary prerequisites.
After
you create a Java stored procedure,
you can deploy, run, and perform other operations on it in the Java perspective as well as in the
SQL and Routine Development perspective. If the Java stored procedure is in a Java application that is enabled for pureQuery, you can also bind
the application to a DB2® database.
Procedure
To create a Java stored
procedure from a method in a Java project:
- Refactor the method code so that it can be used to invoke
the stored procedure.
- Create the Java stored
procedure.
- Optional: If you do not select the deploy option
when you create the Java stored
procedure, deploy the stored procedure.
- Optional: If you create the Java stored procedure in a Java application that uses pureQuery to access a DB2 database, bind the application to the database.
- Run the Java stored
procedure.