How can I move the cursor in the ResultSet?

Hi all,
The following is part of my coding...
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
// TODO add your handling code here:
         ResultSet codes = getCodes();
        try
                codes.first();          
                Code c = getCode (codes);
                jLabel8.setText(c.scode);
                jTextField2.setText(c.name);
                jLabel9.setText(c.ic);
                jTextField4.setText(c.add);
                jTextField5.setText(c.phone);
        catch (SQLException e)
            System.out.println(e.getMessage());
    private static ResultSet getCodes()
        Connection con = getConnection();
        try
        Statement s = con.createStatement();
        String select = "SELECT [Student-File].* " + "FROM [Student-File];" ;
        ResultSet rows;
        rows = s.executeQuery(select);
        return rows;
        catch (SQLException e)
            System.out.println(e.getMessage());
        return null;
    } I would like to moves the cursor to the first row in the ResultSet object...
But an error occured...
Result set type is TYPE_FORWARD_ONLY
I have tried to change
Statement s = con.createStatement();to
Statement s = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE);But a warning existed...
cannot find symbol
symbol : method createStatement(int)
location : interface java.sql.Connection
Can anyone help me?Thanks.
Ning.

Hi,
Actually I would like to create 2 button, one is named as NEXT, another one is named as PREVIOUS. Once i click on the NEXT or PREVIOUS button, a query statement will be executed to retrieve the information of all of the student in a table. At the same time, the name, student code, address, ic and phone number of a student will be displayed by label respectively. After that, if I click on the NEXT button, the information of the current student will be replaced by the information of the next student. By the way, if I click on the PREVIOUS button, the information of the current student will be replaced by the information of the previous student.
Ning.

Similar Messages

  • How can I move the ODI Work Repository from one server to another server?

    How can I move the ODI Work Repository from one server to another server?

    Hi,
    If you would like to move your source models, target models and project contents from Work repository 1 to another work repository.
    I.e. Dev. server to Prod Server.
    1. Firstly, replicate the master repository connections i.e. with same naming conventions manually
    2. Go to Dev. Server work repository -> File Tab -> Click on Export work repository (save it in a folder)
    3. After exporting, you can view the xml files in the folders.
    4. Now, Open the Prod. server and make sure you already replicated mas. rep. details.
    5. Now, right click on model and import source model in synonym mode insert_update (select source model from the folder where your xml file located)
    6. Similarily, import again target then Project.
    Now, check. It should work.
    Thank you.

  • HT4436 I have now downloaded all of my CD's to my itunes library and have since only purchased new music using itunes Store.  This itunes library is stored on an old Dell Desktop that I am getting ready to replace with an iMac; how can I move the music? 8

    I have now downloaded all of my CD's to my itunes library and have since only purchased new music using itunes Store.  This itunes library is stored on an old Dell Desktop that I am getting ready to replace with an iMac; how can I move the music? 86GB
    Is the music I downloaded from my CD's already in the iCloud or only the music I purchased on itunes?

    This might help: http://www.macworld.com/article/1146958/move_itunes_windows_mac.html.

  • I've an apple ID used to buy off iTunes and a mobileme account for the calendars and contacts. How can I move the calendars and contacts to the older apple ID and use it for iCloud?

    I've an apple ID used to buy off iTunes and a mobileme account for the calendars and contacts. How can I move the calendars and contacts to the older apple ID and use it for iCloud?

    If you remeber the password to that Apple ID then follow these steps
    1 - Make sure you have an email address that is NOT an Apple ID
    2 - Go to AppleID.Apple.com
    3 - Where it reads Manage Apple ID - Sign in
    Once you are signed in want to make sure the email address you are wanting to use is NOT set up as a "Recovery/Rescue" email for this account.
    [To check this - Main page where you see Primary ID - below do you see the email address you want to use listed towards the bottom? Yes - Delete / No - Good ./. If made any adjustments "Save" Next on the left select "Password & Security" - Answer your security questions you set up "if you have any" then scroll towards the bottom and check to see if you see the email address you want to use. Yes - Delete / No - Good] <-> Also you can change your password on this page as well. Any adjustments made "Save"
    Once this is done go back to the main page where you should read "Primary ID" and change the email address that is showing to the new email address youo want. "Save" Done
    I learned this not to long ago and worked for me. Hope this helps you!

  • How can you move the objects from one server to another?

    how can you move the objects from one server to another?

    Hi,
    Collecting objects for Transporting
    1. rsa1->transport connection
    2. left panel choose 'object type', middle panel choose 'infocube' and 'select objects'
    3. then choose your infocube and 'transfer'
    4. will go to right panel, choose collection mode 'manual' and grouping only 'necessary objects'
    5. after objects collection finished, create request
    6. If they are $TMP, then change the package.
    7. When you click the Save on the change package, it will prompt for transport. Here you can provide an existing open transport request number, or if you like here itself you can create a new one.
    8. You can check the request in SE09 to confirm.
    Releasing Transport Request  
    Lets say you are transporting from BWD to BWQ
    Step 1: In BWD go to TCode SE10
    Step 2: Find the request and release it (Truck Icon or option can be found by right click on request #)
    Note: First release the child request and then the parent request
    Steps below are to import transport (generally done by basis )
    Step 1: In BWQ go to Tcode STMS
    Step 2: Click on Import queue button
    Step 3: Double Click on the line which says BWQ (or the system into which transport has to be imported)
    Step 4: Click on refresh button
    Step 5: High light the trasnport request and import it (using the truck icon)
    Transport
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/224381ad-0701-0010-dcb5-d74236082bff
    Hope this helps.
    thanks,
    JituK

  • I have 528 contacts on my phone, but only 290 on my Icloud how can i move the rest over from my phone to my Icloud nothing is working

    I have 528 contacts on my phone, but only 290 on my Icloud how can i move the rest over from my phone to my Icloud nothing is working

    Go to Settings>iCloud, turn Contacts to Off, choose Delete from My iPhone when prompted (they will still be in iCloud).
    Download the app My Contacts Backup to your phone.  Use this app to backup the remaining contacts on your phone (from your exchange account) as a vCard attachment to an email that you send to yourself.  Confirm that you have received the email on your phone.
    Go to Settings>iCloud and turn Contacts back to On.
    Go to Settings>Mail,Contacts,Calendars>Default Account (in the Contacts section), set this to iCloud.  (This will cause new contacts added to your phone to be added to the iCloud account.)
    Go to Settings>Mail,Contacts,Calendars...tap your exchange account and turn off contacts syncing (otherwise you will end up with duplicates on your phone).
    Open the My Contacts Backup email and tap the attachment to import the contacts from your exchange account back to your phone.  They will be added to iCloud and appear on icloud.com and any other devices syncing contacts with your account.

  • I have so many photos I only have 1G of memory left.  How can I move the photos to my external hard drive that is connected to my iMac?

    I have so many photos on my Mac I only have 1G of memory left.  How can I move the photos to the external hard drive that is plugged into my iMac.

    1GB? It's a miracle your Mac is running at all!
    This is our resident iPhoto guru, Terence Devlin's, advice:
    You can move your iPhoto Library to an external disk:
    1. Quit iPhoto
    2. Copy the iPhoto Library Folder as an entity from your Pictures Folder to the External Disk.
    3. Hold down the option (or alt) key while launching iPhoto. From the resulting menu select 'Choose Library' and navigate to the new location. From that point on this will be the default location of your library.
    4. Test the library and when you're sure all is well, trash the one on your internal HD to free up space.

  • I am over capacity and think it's because I have Downton Abbey Season 1 saved in iTunes. How can I move the episodes to an external hard drive?

    I am over capacity on my #GS iPhone and I have  a very large amount of audio space that I think might be taken up by season one of Downton Abbey. I have tried to copy and save episodes to my external hard drive but I get a message saying I "don't have permission". How can I move the six episodes out iTunes ??

    dckramermd wrote:
    How can I move software program over to an external hard drive to free up space on my imac.  I have move documents and photos and movies but the only thing left is softward programs.  How do you move them to the external drive?
    EXTREMELY poor idea! Leave the apps on the internal HD. You can move files and libraries from iTunes, iPhoto, iMovie, Aperture, etc.. to an external HD but leave the apps them self on the internal HD.
    Did you empty the Trash after moving all that data to the EHD??

  • How can I move the items in camera roll to my PC?

    How can I move the items in camera roll to my PC. The only option I see is to e-mail each one. Are there other options?

    When you plug you iphone into the computer you should get a box that pops up with the heading "Apple iPhone" and below it says "camera connected". Your computer is treating the iPhone like your digital camera. Below this is several choises. Choose "Microsoft scanner and camera wizard". This will lead you through the steps to create a folder in your computer photo file and you can copy all your photos to that file.

  • How Can I Move the Elements by Tap on Touchscreen or Mouse Down Event in Adobe Edge Animate?

    hi , how can i move the elements by tap on tochscreen or mouse down event in adobe edge animate? like action for moving car.

    in my idea is mousedown action or tap on touchscreen plays the role of car accelerator, (gas pedal) when i left click on mouse my car moves forward and the car doesnt move when I dont click or tap.
    Do you have a solution?

  • How can I move the vertical slider bar from the right to the left of screen

    how can I move the vertical slider bar from the right to the left of screen

    There are also other things that need attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    # Shockwave Flash 10.1 r85
    # Next Generation Java Plug-in 1.6.0_18 for Mozilla browsers
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    Update the [[Java]] plugin to the latest version.
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • How can I  move the 'Itune music file' to another disk

    Hello
    I am using ITUNE in a Winfow XP environnement. I am running out of space on my C disk. How can I move my ITUNE music file
    C:\Documents and Settings\Yves\My Documents\My Music\iTunes\iTunes Music
    to another bigger partition on the same computer?
    Sorry if that question as been answered before I may have missed it.
    Thanks Yves.

    Sorry, there is no way to move that file out of the Profile folder, or specify a different location for it, built into Firefox.
    One extension that might be able to help you do that is Pike's Bookmark Backup extension. BB allows you to specify which files are backed-up and where those backup files are saved. It also has a backup interval setting, IIRC. <br />
    http://www.pikey.me.uk/mozilla/?addon=bb

  • How can I move the photos I've made using my iPhone to my iTunes library and leave no copy on my iPhone?

    I am using an iPhone 3GS and iSO 6.1.3. My iPhone states the iSO software is "up to date" and will check for another version on Dec. 13, 2013.
    I have made photos using my iPhone 3GS and they are currently on my iPhone. I want to move them to my iTunes library, leaving no copy behind on my iPhone. I want these photos completely removed from my iPhone after they are copied to my iTunes library.
    I've tried to adjust the Photo settings and sync my iPhone many, many times, but the photos remain on my iPhone and they are NOT in my iTunes library.
    How can I move these photos from my iPhone to my iTunes library?
    Thank you so much for your help or any suggestion I can try to achieve my goal! I sincerely appreicate your time and attention to matters of my concern.

    I just used Windows Explorer (in Windows 7) opened my iPhone, copied the DCIM file and now I will attempt to import my photos into iTunes. I believe I answered my own question - I just thought there would be a way to do this via iTunes (I should have known better).

  • We switch from an old email address to a new one. How can we move the data from the calendar?

    We move to a new email address. How can we move all the data from the calender (iCloud) to the new calender (because the iCloud is now based on a new email address)

    Go to appleid.apple.com and sign in with your current Apple ID
    Change the Apple ID to the old one and save changes.
    Sign in on the device with the same password for your account.
    After logging in and signing out of Facetime, Messages, iCloud and itunes and app store, go back to Apple ID.com and change it back to your normal Apple ID.
    Go to your email account and reverify your account by clicking on the Verify now link
    Now re-login to those services with your normal Apple ID and password.

  • I cannot open movie rentals on the ipod. if I try to update it it tells me to move the rentals back into my Library bu I tunes will not allow me to do that. how can I move the rebtals back into the library?

    How can I move rentals from my Ipod back into my I tunes Library?

    Try disabling the computer's antivirus and firewall.
    - Next try the manual install method of:
    iDevice Troubleshooting 101 :: iPhone, iPad, iPod touch
    Place the iPod in recovery mode after the firmware download is complete and then restore using the instructions in the article. Sometimes recovery mode timeouts and returns to disabled before the firmware download is complete.
    - Then try on another computer

  • How can I move the trash icon to a different spot on my desktop?

    How can I move my trash icon to a different location on the desktop?

    Here is a comprensible answer on that.
    Here is the answer (not by me): Remove Separator and Trash from Dock?
    This answer is for Yosemite however it could be adjusted to use it on 10.6
    Please make sure you understand all the instructions before doing anything.
    Here is not a so complete answer for 10.5 http://hints.macworld.com/article.php?story=20090523192819542
    As before, make sure you understand the instructions before doing anything

Maybe you are looking for

  • Unable to print from my Iphone to my eprinter

    I can login to my HP eprint account and see my printer and print to it. I can also print to my printer on my WIFI from my iPhone 5. The problem is I can not print to it from my iPhone when I'm alway from my office? At one time I was able to do this.

  • When i open itunes it gives me an option for itunes U and podcasts download

    Hello, I just purchased an Iphone 5.  When I open up Itunes, it gives me a screen that has two tabs at the bottom.   One tab is for Itunes U and another is for Podcasts.  When I click on either tab, it asks me to either download or open.  I downloade

  • Why does my external Hard Drive not save album artwork? Help!

    I have quite a lot of music saved digitally, so to save space I have been storing it on an external hard drive. Some of the music does not have any artwork attached (and does not download any when I select 'get album artwork'). So, as an example, sta

  • Image Gallery or Lightbox that works for DW CS6?

    Help! I need an image gallery or lightbox that works! I tried the Lightbox Gallery in Widgets and while it works for the most part, the nav buttons don't show up and I've put the files in every directory (path) possible. Does anyone have a fix for th

  • Urgent MF60 Steploop Issue

    Hi, When I run the t-code MF60, I get a list of Materials for Staging. Now there is a step loop to select the materials which I want to see the Staging. Say, I select all materials (from the Select All Button) and when I click Stage > Individual Log,