anandaraj krishnan

Greenhorn
+ Follow
since Sep 13, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by anandaraj krishnan

Hi,
I would like to know,how to get more than 1 record from oracle db(by calling stored procedure) in Java.What I did is I created a Stored Procedure in oracle as :
CREATE OR REPLACE PROCEDURE getControlData(seqNum OUT seqPack.seqCur) AS
BEGIN
OPEN seqNum FOR SELECT SEQ_NO FROM CONTROL_M;
END;

CREATE OR REPLACE PACKAGE seqPack AS
TYPE seqCur IS REF CURSOR;
END seqPack;
So if I want to call this Stored Procedure from simple Java class file using JDBC,wat I need to do.I know very well that I've to use callableStatement in Java.Sql.*. But I don't know how to call a stored procedure which expects input as CURSOR.
Or if anyone knows how to get multiple rows using Storedprocedure(by creating in someother way in oracle) please let me know.It would bereally grateful.
Thanks in advance.
------------------