File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes How to return a cursor in DB2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "How to return a cursor in DB2" Watch "How to return a cursor in DB2" New topic

How to return a cursor in DB2

Aravind Bhat
Ranch Hand

Joined: Jun 16, 2006
Posts: 32
Hi guys ,

I want to return the cursor in db2 to retrieve the resultset from
my java application .Keeping the cursor open dosen't help and the resultset always returns a null though the procedure runs fine from the command line. Any ideas .


CallableStatement stmt3 = HibernateApp.getHibernateSession().connection().prepareCall("{call answers_select_id( ? )}");
ResultSet rs1 = stmt3.getResultSet();
System.out.println("rs1 " + rs1); --> returns null
I agree. Here's the link:
subject: How to return a cursor in DB2
It's not a secret anymore!