ResultSet « db2 « Java Database Q&A





3. Resultset returns null from a srored procedure in db2    coderanch.com

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 ...

4. Handling Mulitple ResultSets of DB2 using CallableStatment in JAVA    dbforums.com

Hello Group, The situation is as follows: the java code written to interact with DB2 directly works fine and we can handle the above problem. However if we use a DATASOURCE defined in the application server (WAS 5.0) we are able to get only the first result set using callable statements. Where are we going wrong? Please help us

5. DB2 resultset closed automatically    dbforums.com

I am using UDB 8.0 on AIX. I am using type 4 driver (db2jcc.jar) and my Web application runs on Websphere.I call a stored procedure/sql (witih an EJB method) that returns me a resultSet of few records.I traverse thru the result set using a simple while(rs.next()) { ...}. When I do this, an SQLException is thrown saying "Invalid operation : result ...

6. Resultset returns null while calling a DB2 stored procedure using hibernat    forums.oracle.com

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 ...