Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet Fnction

 
Srinivasa Vallabha
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
Please help me.
When we get ResultSet say "rs" from the database, we usually get the data or records from this by using
rs.next() function right ?
but when we go thru the specifiction of ResultSet we will find rs.previous(), rs.last(), rs.first().....functions.
I am using JRUN 3.0 when I tried to use rs.previos() function it gives an exception as given below.
java.lang.UnsupportedOperationException
So please tell me which Server supports all the above said functions ?
Thankx in Advance to all folk's
Srini
 
hemanth kumar
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srini
I do not think the container in which u run has any effect on the functions of recordset.
u have to implement a fully scrollable recordset if u req previous,last... functionality for recordsets.
Pass appropriate arguments in the createStatement(). for ex
con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE);
Now u can user the previous,last,first methods after opening the recordset.
Hope this helps
Hemanth
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure the JDBC drivers you are using support JDBC 2.0 functionality.
 
Raja Shekhar
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thomas..
How Shold i make sure that
My driver Support JDBc2.0 functionality..
Please Eloboarate...

Thanx...
Raj
 
Srinivasa Vallabha
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Raj,
Look I am using JRUN3.0 ok.
When I create a Result Object and access the Database, Its working fine. And I can also able access the Records by using rs.next() function.
But when I want to use the rs.previos() | rs.last() | rs.first() function of the ResultSet.
I am getting an Exception Saying that Unsupported operation.
So somebody told me that I have to check out for JDBC2.0 functionalities in my JDBC:ODBC rivers.
So how can use these functions ? Tell me (if possible thru some code)
Thanx in advance
Srini
 
Monty Ireland
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you are using a JDBC ver 1.0 driver.
I think you should review the java.util package...
Pls review the List, Iterator, & ListIterator classes.
After reviewing the doc. If you have any questions Pls ask away.
ttfn Monty
------------------
Multi-Platform Database Developer ( on E.S.T. )
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic