473,385 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Resultset returns null while calling a DB2 stored procedure using hibernate

2
Hi All ,
I am trying to call a db2 stored proc with cursor open from my java code but it always returns me null results though it executes fine when I call the procedure from the command line

Java code....................

CallableStatement stmt3 = EyeHibernateApp.getHibernateSession().connection() .prepareCall("{call answers_select_id( ? )}");

stmt3.setString(1,20);
stmt3.execute();

ResultSet rs1 = stmt3.getResultSet();
System.out.println("rs1 " + rs1); --> returns null

procedure-------------

CREATE PROCEDURE answers_select_id (IN question_id bigint )
P1:BEGIN
DECLARE cursor1 CURSOR WITH RETURN TO CLIENT FOR
SELECT a.answer_id from answers as a where a.question_id = question_id;
open cursor1;
END P1;

I am using the same java code with mysql stored procs . It works fine there but I assume open cursors in db2 stored proc is causing the problem . If I can help it , I need to maintain the same java code for mysql ad db2 . Please help me ...

Thanks,
Av~
Dec 17 '07 #1
0 2545

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jonathan Beam | last post by:
I'm trying to create a wrapper procedure. The procedure I'm calling returns 2 resultsets. I really only need the second, but I'm not sure how to get the second resultset. Is there something like...
1
by: June Moore | last post by:
Hi, I would like to write a stored procedure that returns a resultset. e.g. select student_id, student_subject, subject_marks from student_results where student_class_no = ? The input...
2
by: Savas Ates | last post by:
I have a stored procedure below.. When I run it with a well parameter in query analyser 3 of select statements return me. (i named select statements 1,2,3) But in asp page when i call this...
3
by: Koen | last post by:
Hi, first of all, the machine setup server 1: - UDB2 7.2.5; COUNTRY=1, location = US, IBM1250 codepage - Locale: US English; Regional Settings: English; Keyboard: Dutch; decimal separator: ....
2
by: Twan Kennis | last post by:
Question: How do I pass a returning resultset from a nested Stored Procedure (which opens a cursor including option "WITH RETURN TO CALLER") as a returning resultset from it's own? When I...
4
by: _link98 | last post by:
Problem: java ResultSet cursor from SQL/PL stored-procedure is FORWARD_ONLY. Is it possible to have ResultSet cursors from SQL/PL procedures to scroll forward and backwards? Perhaps I am missing...
12
by: robertino | last post by:
Hi all, I've put together a few SPs to produce a BOM (bill of materials) listing, which together use a couple of global temp tables, and return the results from a cursor. Here's the code: ...
9
by: serge | last post by:
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio...
0
by: Purple Haze | last post by:
I have a stored procedure which returns a resultset. I am calling that stored procedure from UNIX shell script. I want the data in the result set to be exported to a .csv file. How can I do this...
0
by: av~ | last post by:
Hi All , I am trying to call a db2 stored proc with cursor open from my java code but it always returns me null results though it executes fine when I call the procedure from the command line ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.