The Artima Developer Community
Sponsored Link

Java Answers Forum
ResultSet going out of scope

2 replies on 1 page. Most recent reply: Sep 16, 2003 5:22 AM by sdinesh79

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Mike Hirst

Posts: 2
Nickname: marshmello
Registered: Sep, 2003

ResultSet going out of scope Posted: Sep 15, 2003 10:31 AM
Reply to this message Reply
Advertisement
I am trying to enable a user to scroll through the records from a database one at a time by using a previous/next combination of buttons. I create a new database statement then postion to the first record from the database and then present the user with a screen that contains the first record. I have put a "Next" button on the screen but when I try to add code to get the next record the ResultSet variable is out of scope and I can not reference it. I belieive this is happening because the resultset is declared in one method and I am trying to use it in another method. The first method is declared "public static void getrecord()" and the ResultSet DocumentResultSet is declared in this method. Can someone tell me how either to make DocumentResultSet visible to other methods or point me to a place that shows example code that enables you to scroll through a record set. I have tried sun's site and it is not very helpfull


Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: ResultSet going out of scope Posted: Sep 15, 2003 7:32 PM
Reply to this message Reply
Instead of declaring ResultSet as a method variable why dont you declare as a private member variable for the class???

sdinesh79

Posts: 7
Nickname: sdinesh79
Registered: Sep, 2003

Re: ResultSet going out of scope Posted: Sep 16, 2003 5:22 AM
Reply to this message Reply
This link should help u

http://developer.java.sun.com/developer/Books/JDBCTutorial/

Flat View: This topic has 2 replies on 1 page
Topic: What's Happening to Artima? Previous Topic   Next Topic Topic: problem with my java class

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use