How we store procedure in oralce for callable statements in jdbc
Answer Posted / Kaushal Kishor Mishra
[{n 'QNO': '101344',n 'question': 'How we store procedure in oracle for callable statements in jdbc',n 'answer': 'To create a stored procedure in Oracle that can be called using JDBC, follow these steps:nn1. Connect to the Oracle database and create a new package:nn CONNECT / as sysdba;n CREATE OR REPLACE PACKAGE myPackage ASn PROCEDURE myProcedure(p_param IN number);n /nn2. Define the body of the stored procedure inside the package:nn CREATE OR REPLACE PACKAGE BODY myPackage ASn PROCEDURE myProcedure(p_param IN number) ISn BEGINn -- Your SQL code heren END myProcedure;n /nn3. Compile the package:nn ALTER PACKAGE myPackage COMPILE;nn4. Test the stored procedure using SQL*Plus or another Oracle client.nn5. Use JDBC CallableStatement to call the stored procedure from your Java code.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers