Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Output parameter in java stored procedure

441437Apr 6 2005 — edited Apr 7 2005
How are you All
I want to ask about out put parameter in java stored procedure
and how we can passing the out put parameter from java method to
oracle stored procedure then return this out put to the application.
Another question How we can writing more code in java stored procedure
other than calling Java method.

================================================================================
Sample code is

JAVA CODE IS
=============
import sqlj.runtime.*;
import java.sql.SQLException;
import oracle.sqlj.runtime.Oracle;
import java.sql.*;

class TmpDML
{
//Insert method
public static void insert(oracle.sql.NUMBER radius
,oracle.sql.NUMBER area
,oracle.sql.NUMBER id) throws SQLException
//third parameter must be out put parameter
{
try
{
#sql {insert into tmp(f1,f2) values(:radius, :area) returning id into :out id};
}
catch (SQLException e){System.err.println(e.getMessage());}
}// end insert method
}// end class
========================================================================================================
ORACLE CODE IS
===============
CREATE OR REPLACE PROCEDURE RAISE_SALARY
(PI_RADIUS NUMBER
,PI_AREA NUMBER
,PO_ID NUMBER)
/*third parameter must be out put*/
AS LANGUAGE JAVA NAME 'TmpDML.insert(oracle.sql.NUMBER, oracle.sql.NUMBER, oracle.sql.NUMBER )';
========================================================================================================

Thank you
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2005
Added on Apr 6 2005
2 comments
1,177 views