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 previous & Last Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "previous & Last" Watch "previous & Last" New topic

previous & Last

Abhay Kumar

Joined: Jun 03, 2003
Posts: 15
Using jdbc API, I tried using these methods:
previous(), next(), last()...
to scroll through the data.
But i am unable to do it.
Does this have to do anything with the drivers?
What can be the probable reason. Sytax is all correct
Renju Philip

Joined: Oct 28, 2002
Posts: 4
JDK provides us with interfaces. The implementation has to come from the drivers which we use. We need to see whether the driver has implemented these methods
Vamshi Krishna

Joined: Apr 22, 2003
Posts: 4
When you load a JDBC driver, create a connection and then create a statement object with the following syntax,
If "con" is the connection object created.
Statement st= con.createStatement();
This is the default connection type we create. The default parameters internally passed with the create statement are
Hence you were uanble to use the JDBC2.0 API.
But to use JDBC2.0 API which provides you with a advantage of dual-moving and updatable result set, you should pass these parameters in the createStatement method to work with JDBC2.0 API.
Please write your create statement as:
Statement st= con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Now try any method in JDBC2.0 API, it works.
Also refer the link below for more information:
Hope the above information will be helpful to you. If you need further help, please contect me. I will help you out it I can.
[ June 17, 2003: Message edited by: Vamshi Krishna ]

Abhay Kumar

Joined: Jun 03, 2003
Posts: 15
Thank You Vamshi and also philip for your answers.
I cannot change the drivers now. So will try with vamshi's suggestions.
Thanks for the answers
I agree. Here's the link:
subject: previous & Last
It's not a secret anymore!