File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DB2Exception on rs.next()

 
Ted J Schrader
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have stumbled on a very frustrating error that may be of interest to others. Note that this error only occurs every once in a while.
First, the error:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0501N The cursor specified in a FETCH or CLOSE statement is not open. SQLSTATE=24501
Now, the old code:

As noted in the code, it bombs at rs.next(). On the database, the NTFTN_DT column is defined on DB2 as DATE.
Now, if I change

to

it will start to work.
I've been told that even this isn't the best way to do this; just hard-code CURRENT DATE in the SQL to ensure that we are getting database date instead of server date.
Hope this helps.
Ted Schrader, SCJ2P
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic