You can create Java stored
procedures from methods in Java projects.
You use a single method in a Java class
to create a single Java stored procedure. You can use
multiple methods in the same Java project
to create multiple stored procedures in the project.
During the creation and deployment of a Java stored
procedure, dependencies in the Java project
are handled in the following manner:
- JAR files that are present within the project, that is, those
that have been physically copied or imported to the project, are deployed
as dependent JARs.
- External JAR files that are referenced outside the project are
referenced in the classpath at compile time, but are not deployed.
The external JAR files are assumed to already exist on the server;
for example, the JDBC driver and JVM.
The distinction between internal
and external JAR files is made when the Java stored
procedure is being created. Later, you can modify this setting, as
well as other settings, to make them appropriate for your environment.
Limitations:
- A Java project in which you want to create Java stored procedures from methods can have
only one database connection.
- With DB2® for z/OS® data servers, support for
creating Java stored procedures from methods
in pureQuery-enabled Java projects
is limited to Type 4 connections.
- For other server support limitations, see Stored procedure and user-defined function support by
server type
After you create the Java stored
procedure, the Java project that contains the stored
procedure is visible in both the Java perspective
and the SQL and Routine Development perspective. You can operate on
the stored procedure in either perspective.