Generating Java Source Code for PL/SQL Programs
To generate Java source code (.java
and .sqlj
files) for a PL/SQL program, use JPublisher:
-
Select View | Connection Navigator
.
-
Expand Database and select a database
connection.
-
In the database connection, expand a schema.
-
Expand the folder that contains the program or object (each package
body is in a folder within the Packages folder, and each object type
body is in the corresponding Object types folder).
-
Right-click the program or object, and choose G
enerate Java from the context menu. The JPublisher wizard opens.
-
Change any default values or add values to the wizard as needed,
especially project and package names, and click OK
.
-
JPublisher generates the files and JDeveloper stores them in the
project and package you specify. They are accessible from either the
Application Navigator or System Navigator:
-
Application Navigator: Workspace_name
> Project_name > Application Sources >
package_name > object_name.sqlj
-
System Navigator: Workspace_name >
Project_name > object_name.sqlj
To generate Java source code for a folder of PL/SQL programs, use
JPublisher:
-
Select View | Connection Navigator
.
-
Expand Database and select a database
connection.
-
Expand the connection, and right-click a folder, and choose
Generate Java from the context menu. The JPublisher wizard opens.
-
Change any default values or add values to the wizard as needed,
especially project and package names, and click OK
.
-
JPublisher generates the files and JDeveloper stores them in the
project and package you specify. They are accessible from either the
Workspace Navigator or Application Navigator:
-
Workspace Navigator: Workspace_name >
Project_name > object_name.java
-
Application Navigator: Workspace_name
> Project_name > Application Sources >
package_name > object_name.java
A single Java file is generated.
Related topics
Creating, Editing and
Using PL/SQL Programs
Accessing
Oracle Objects and PL/SQL Packages using Java
About JPublisher
Copyright © 1997, 2004, Oracle.
All rights reserved.