• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

previous & Last

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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
Help
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Thanks
renju
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
TYPE_SCROLL_FORWARD AND CONCUR_READ_ONLY
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:
http://java.sun.com/docs/books/tutorial/jdbc/jdbc2dot0/cursor.html
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
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic