Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scrollable support with JDBC Driver?

 
Jason Allen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to find out if the driver I am using for JDBC has scrollable support. Whenever I try to use first() previous() etc, I get a method not found in RecordSet class. The driver name I am using is libdb2.a and it is version 07.01.0000 I was thinking it supported JDBC 2.0 specs, but I'm not sure. Maybe I possibly have an old driver or something.
I'm instantiating the connection object using COM.ibm.db2.jdbc.app.DB2Driver
I'm running on RS/6000 w/AIX and DB2 7.1 EEE.
Any ideas?
Jason.
 
Jason Allen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Argh! Well I think I found my problem. After a little bit of research, I found that our RS/6000 had JDK v1.1.8 installed hence being on a version that I don't believe supported scrollable resultsets. I now have our system admins downloading and installing v1.3 and that will hopefully fix my problem.
Thanks,
Jason.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The version of the JDK is one thing but you also need to make sure that the driver you are using supports JDBC 2.0.
 
Jason Allen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
From my understanding, the DB2 jdbc driver does support scrollable recordsets, however, it doesn't support TYPE_SCROLL_SENSITIVE. I haven't been able to test this yet, but I should very shortly.
Thanks for your reply,
Jason.
 
Jason Allen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have finally gotten this all to work, it was kind of a nightmare, but it is working. Here are the points to make sure of to get this to work.
1) TYPE_SCROLLABLE_SENSITIVE is not supported by DB2 drivers
2) TYPE_SCROLLABLE_INSENSITIVE is supported
3) Make sure you are on the latest Java version (I'm using v1.3)
4) DB2 by default doesn't enable support for JDBC 2.0, you MUST add this support via environment variables. There is a script that they supply called usejdbc2 (what a surprise) This script needs to be called from your profile or webserver profile depending on your environment.
5) You must use the correct DB2 lib files. The required file is libdb2jdbc.so There are two versions of this. One is located under DB2/lib, the correct one to use for JDBC 2.0 is found in DB2/java12
6) I couldn't find where to set the correct path to allow tomcat to find this file, so I created a symbolic link in the java130/jre directory
Good luck with anyone else having these troubles, hope this saves someone time in the future.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic