This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes ResultSet Fnction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet Fnction" Watch "ResultSet Fnction" New topic
Author

ResultSet Fnction

Srinivasa Vallabha
Greenhorn

Joined: Mar 08, 2001
Posts: 15
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

Joined: Mar 15, 2001
Posts: 55
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

Joined: May 05, 2000
Posts: 13974
Make sure the JDBC drivers you are using support JDBC 2.0 functionality.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Raja Shekhar
Ranch Hand

Joined: Apr 02, 2001
Posts: 49
Hi
Thomas..
How Shold i make sure that
My driver Support JDBc2.0 functionality..
Please Eloboarate...

Thanx...
Raj
Srinivasa Vallabha
Greenhorn

Joined: Mar 08, 2001
Posts: 15
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

Joined: Oct 03, 2000
Posts: 161
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. )


Multi Platform Database Developer & DBA on E.S.T.
 
Don't get me started about those stupid light bulbs.
 
subject: ResultSet Fnction
 
Similar Threads
Multiple JVMs?
Page is refreshing continously on IE
EL functions in FACELETS...
java stored procedure problems
Strange - Page Submits!!!