Creating Java stored procedures

You can create Java™ stored procedures from methods in Java projects.

Before you begin

The method from which you want to create the stored procedure must have a valid stored procedure signature.

About this task

To create a Java stored procedure from a method in a Java project:

Procedure

  1. In the Package Explorer, expand the Java project, and then double-click the Java class that contains the method from which you want to create the Java stored procedure.
  2. In the Java editor, locate the method from which you want to create the Java stored procedure, right-click within the method code, and then select Create Stored Procedure. The Create Stored Procedure wizard opens.
  3. Complete the pages of the wizard.
  4. Click Finish.

Results

The Java stored procedure is created as an .spxmi file in the Java project. After the stored procedure is created successfully, the Java project is visible in both the Java and SQL and Routine Development perspectives. You can work with the stored procedure in either perspective in the Routine editor. Double-click the stored procedure file to open it in the Routine editor.

If you selected the Deploy check box on the Define Stored Procedure page of the wizard, the Java stored procedure is deployed after it is created. After the stored procedure is deployed, you can refresh the Stored Procedures folder under the database connection in the Data Source Explorer view to verify that the stored procedure was added to the server.

If you did not select the Deploy check box, you can deploy the Java stored procedure by using the Deploy command on its pop-up menu in the SQL and Routine Development perspective. You also can deploy the stored procedure in either perspective by opening it in the Routine editor and then using the Deploy command in the editor.

You can perform any of the actions on the Java stored procedure that are available from within the Routine editor, including deploy, run, and debug.


Feedback