I have written one stored procedure which will return integer value. but am not able to get the count in jpa. can any one suggest me the way to call stored procedure and get the return out value into some variable in java using jpa.
int count = 0;
String id = "m123"
count = getEm().createNativeQuery("call sample_procedure(?,?)")
.setParameter(1, id)
.setParameter(2, count)
.executeUpdate();
stored procedure: I have some logic in procedure and inside loop I was incrementing the count.
create or replace
PROCEDURE sample_procedure(
id IN VARCHAR,
count OUT NUMBER)
IS
........
BEGIN
.....
LOOP
---------
count := count + 1;