ResultSet not responding to next() method

Please Help i have this result set object that is not null sure of it because i checked by using if(reslt!=null) then i used a while loop to go through the object but to no avail i even debuged by using System.out.println(). Help !!.
[if(evnt.getSource()==okBtn){
               ResultSet resltset=null;
               try{
                    DataBaseConnecter dataBaseConnecter=new DataBaseConnecter();
                    resltset =dataBaseConnecter.executeQuery(query);
                    if(resltset!=null&&resltset.next()){
                         System.out.println("Iam not null");
                         while(resltset.next()){
                              System.out.println("I got here ");
                              String sdr=resltset.getString(1);
               }catch(SQLException sqlex){
                    sqlex.printStackTrace();
               catch(NullPointerException npe){
                    npe.printStackTrace();
               }]

if(evnt.getSource()==okBtn){
ResultSet resltset=null;
try{
DataBaseConnecter dataBaseConnecter=new DataBaseConnecter();
resltset =dataBaseConnecter.executeQuery(query);
if(resltset!=null&&resltset.next()){
System.out.println("Iam not null");
while(resltset.next()){
System.out.println("I got here ");
String sdr=resltset.getString(1);
}catch(SQLException sqlex){
sqlex.printStackTrace();
catch(NullPointerException npe){
npe.printStackTrace();
}One big problem with this statement is that you are not testing to see if a resultset was returned, you are just confirming that the reference variable resltset points to an object in memory, as it should.
if(resltset!=null&&resltset.next()){
A better statement would be,
if (resltset.first()) {
... because if this method returns true then you are moved automatically to the first row, and if it returns false then the ResultSet object is empty and you skip the code block.
Also, you are getting the TYPE_FORWARD exception because the ResultSet is set to TYPE_FORWARD only.

Similar Messages

  • I can't launch Safari. When I right click on the icon, the "Application not responding" is grey and no matter what method I use to Force quit, I get no response.

    I can't launch Safari. When I right click on the icon, the "Application not responding" is grey and no matter what method I use to Force quit, I get no response.

    Do a backup.
    Quit the application.
    Go to Finder and select your user/home folder. With that Finder window as the front window, either select Finder/View/Show View options or go command - J.  When the View options opens, check ’Show Library Folder’. That should make your user library folder visible in your user/home folder.  Select Library. Then go to Preferences/com.apple.Safari.plist. Move the .plist to your desktop.
    Restart the computer, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.
    Thanks to leonie for some information contained in this.

  • Lost my iPad and when I attempt to use the "LOST" feature in icloud, the NEXT and CANCEL buttons are not responding.  I have tried this on 3 different windows based computers.  Any ideas???

    When using icloud because I lost my ipad...when i attempt to use the "LOST" feature the "next" and "cancel" buttons do not respond.  I have attempted this on 3 different windows based computers on 3 different networks.  Any ideas? 

    Report to police along with serial number. Change all your passwords.
    These links may be helpful.
    How to Track and Report Stolen iPad
    http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
    Reporting a lost or stolen Apple product
    http://support.apple.com/kb/ht2526
    Report Stolen iPad Tips and iPad Theft Prevention
    http://www.stolen-property.com/report-stolen-ipad.php
    How to recover a lost or stolen iPad
    http://ipadhelp.com/ipad-help/how-to-recover-a-lost-or-stolen-ipad/
    How to Find a Stolen iPad
    http://www.ehow.com/how_7586429_stolen-ipad.html
    Apple Product Lost or Stolen
    http://sites.google.com/site/appleclubfhs/support/advice-and-articles/lost-or-st olen
    Oops! iForgot My New iPad On the Plane; Now What?
    http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
    If you don't know your lost/stolen iPad's serial number, use the instructions below. The S/N is also on the iPad's box.
    How to Find Your iPad Serial Number
    http://www.ipadastic.com/tutorials/how-to-find-your-ipad-serial-number
     Cheers, Tom

  • Firefox thinks its running but not responding shut computer down won't clear deleted and reinstalled still won't clear , what next?

    I have seen this error before and normally if you close down you system and restart it will clear up but not this time. I even uninstalled and reinstalled firefox. started this morning when facebook went down for maintaince. that was about 8 it 2 now and I still can't clear it what can I try next?

    See
    * [[Firefox is already running but is not responding]]
    Try closing any running instances of ''firefox.exe'' (and plugincontainer.exe) using something such as Task Manager. That should allow you to then restart Firefox.
    As for iLivid. Possibly it also has associated apps or extensions with names not including the word iLivid. Looking at their own FAQs there are instructions to remove iLivid using the Windows Control panel, and mention of other bundled software that you may wish to remove. It seems it is more of a nuisacne rahter than out and out malware.
    * see http://www.ilivid.com/faq.htm (page scrolls for more info) but includes:
    How do I uninstall the software?
    The software can be removed in a simple was like any other software:
    Go to the Windows Start menu and then to Control Panel > Add/Remove ("Programs & Features" in Vista & Windows 7) and click "Remove" next to the software name (e.g iLivid Download manager / Windows iLivid Toolbar ).
    During the installation bundle software are offered, each can easily be removed following those instructions: Uninstall Yontoo Addon , Uninstall Search Toolbar (powered by Bing) or Uninstall Babylon.

  • Control the loop of resultset.next( ); (method)

    Hai, guys
    I am using the ODBC database connection to (Excel Sheet) and i wanna get the records from it. My code is scucess but there is a problem in resultset.next() method.
    The thing is it retrieving all the data including the none data fields (null null), so finally it became a never ending loop.
    pls help me to get the data rang's records
    Statement stmnt = connexl.createStatement();
    String query = "SELECT * FROM [IJTS$]";
    stmnt.execute(query);
    ResultSet rsxl = stmnt.getResultSet();
    while(rsxl.next()) {
    String excelname = rsxl.getString(1);
    String excelcate = rsxl.getString(2);
    System.out.print(rsxl.getString(1));
    System.out.println(" "+rsxl.getString(2));
    }

    if null implies it has reached the last row, maybe you could check for null and break from the loop
    for example:
    while (rsxl.next()) {
      String excelname = rsxl.getString(1);
      String excelcate = rsxl.getString(2);
      if (excelname == null && excelcate == null) {
        break;
      } else {
        System.out.println(excelname + " " + excelcate);
    }

  • TS4006 Phone deactivated  -  My iphone 5 has on its' own de-activated itself.  It requires my apple id and password to re-activate.  Upon this command, I press next, to which it says: server not responding.  Rendering my phone useless...please help

    Iphone de-activated itself  -  it won't accept the ID and password as it says:  server not responding, rendering the phone useless...please help

    i'm in the same situation. waiting for an answer.

  • I-Pod touch only gives me the Apple symbol and will not respond to anything tried, including the "restore" method. Any clues? Thanks

    I-Pod touch will not respond. I tried to "restore" it through I-Tunes and update which took nearly two hours, but it still only gives me the Apple symbol and does nothing else whatsoever. It seems completely locked up. Any help? thanks much!

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar

  • Server not responding internet Only works when sitting next to the router all over devices work fine apart from iPhone 5

    I Have a iPhone 5 and the internet doesn't connect when im not sitting right next to then router I have put it back to factory settings and it still can't connect , all of my other devices are fine what shall I do?

    That could be a hardware problem with the WiFi antenna. Contact Apple Support for assistance: Contact Us

  • Help! My ipod touch just shows the apple icon and will not respond. Have tried reset and down load.  what next?

    Help, my ipod touch froze up, it showes the apple icon only, tried to restore and download but nothing.

    Try here:
    iOS: Not responding or does not turn on

  • Blackberry ID is not responding

    I did a security wipe on my bb q5 device, after the phone turned on, i selected a language, choose a wifi connection , swipe left to choose my country and agree to terms and conditions, but the agree to terms page won't load, it takes me to the homepage. I can't access and application on the phone, i tried using my bbm, it required I log in to my Blackberry ID tried doing that but my phones says Blackberry ID not responding. Please what can I do to fix it,

    Hi and Welcome to the Community!
    With a strong carrier network signal (e.g., not merely WiFi), I suggest the following steps, in order, even if they seem redundant to what you have already tried (step 1 should result in a message coming to your BB...please wait for that before proceeding to the next step):
    1) Register HRT
    KB00510 How to register a BlackBerry smartphone with the wireless network
    Please wait for one "registration" message to arrive
    2) Reboot
    Pre-BB10 Devices ONLY. With power ON, remove the back cover and pull out the battery. Wait about a minute then replace the battery and cover. Power up and wait patiently through the long reboot -- ~5 minutes.
    BB10 Devices. Hold the top button down until the counter reaches zero. Wait for the device to be fully shut down (e.g., nothing at all displayed on the screen, no LED lights, etc.). Hold the top button until the red LED is lit. Wait through the full boot-up process. IF this fails, you can attempt the battery-pull method above, but it is normally NOT recommended unless nothing else works.
    See if things have returned to good operation. Like all computing devices, BB's suffer from memory leaks and such...with a hard reboot being the best cure.
    Hopefully that will get things going again for you! If not, then you should contact your mobile service provider for formal support.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • MG3520 printer not responding

    It worked then I got a new internet provider it gave me the error message but I reconnected and it worked. Now it won't? Same message Printer not responding but it shows up as ready?
    Solved!
    Go to Solution.

    Hi 69maverick,
    We recommend reinstalling the drivers and software for the printer using the latest drivers from the Canon USA website to get your printer reconnected to your network.  Please click here to go to the Drivers and Software page for the PIXMA MG3520.  Once on the initial download page for your model, please do the following:
    1. Verify that the operating system detected in the "OPERATING SYSTEM" drop-down menu is correct, and if it is not, please click the drop-down menu to select your operating system.
    2. Next, please click on the red arrow next to the "RECOMMENDED FOR YOU" section and click the FULL DRIVER AND SOFTWARE PACKAGE file. When you do, a red DOWNLOAD button will appear. Please click on the checkbox below the DOWNLOAD button, then click the red DOWNLOAD button to begin the download. The time for the download process may vary depending on the speed of your Internet connection and the size of the file being downloaded.
    Once you have downloaded the Full Driver and Software Package file, please double-click on the file and follow the steps provided to reinstall the printer wirelessly.
    Hope this helps!
    This didn't answer your question or issue? Please call or email us at one of the methods on the Contact Us page for further assistance.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Diresctory server not responding

    1. After some time of continously using the system for say 3-4 hrs application does not responds through webconnector plugin .we have created a simple java class which invokes the method of ejb it is working fine. Through simple test jsp which is on web server we are able to communicate to app server through IIOP port 9010 but while communicating through webconnector plugin and calling a jsp which is on application server its hanging theres nothing in log file and the solution is to restart the services of directory server and application server .

    Hi,
    I like to help you for which I like to understand if the problem is really with the directory server or the web connector plugin. I would like to test the webconnector for which I recomend you to restart the web server when you experience the same problem next time. Please let me know your opinion on this.
    Regards
    Ganesh .R
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • Touch not responding

    My driod 2 screen went blank so I reboted it now the touch screen is not responding and I cant even unlock my phone. What do I do?

        Hello Tellemtwice234,
    Oh my! Having a touchscreen that won't respond is never a good thing. There are many things that can factor a non responsive screen. Most of the time; it is a result of a recently installed application. I definitely want to get this fixed for you.
    Let's try running your phone in Safe Mode. Slide your keypad up on your Droid 2; Press and hold the "OK" key while powering the phone on. Here is a visual to enable and disable Safe Mode:http://bit.ly/o5McAQ.
    We recommend keeping the phone in this mode and testing the touchscreen out. If it is responding properly while in Safe Mode, remove the most recently installed applications then power the phone up to test in normal mode.
    If you are unable to determine which applications are causing the freezing; the next step would be a Master Reset using the Alternative method: http://bit.ly/GPI14h.
    Let us Keep us posted. We are here to help.
    Thanks,
    TanishaS_VZW
    Follow us on Twitter @VZWSupport

  • Annoying error 2:  ViewController may not respond to -enableBBI

    Developers,
    This is my second annoying error. The code works fine, but i get the following error message when i run the app "viewcontroller may not respond to -enableBBI".
    The code i am using is below and i have placed ///Error/// next to parts of the code that trigger the error. The part of the code that shows an error is used to enable a Bar Button item.
    Is there anything i can do to prevent this? or does it not really matter?
    Ray, i am hoping you will have a quick glance over this. The code is something you gave me in the past. Perhaps you have a solution?
    james
    -(IBAction)NextItem {
    int count = [flashCards count];
    if (counter < count - 1) {
    NSDictionary *nextItem = [self.flashCards objectAtIndex:++counter];
    Label1.text = [nextItem objectForKey:Question_KEY];
    [self enableBBI]; ////Error//////
    -(IBAction)PreviousItem {
    if (counter > 0) {
    NSDictionary *nextItem = [self.flashCards objectAtIndex:--counter];
    Label1.text = [nextItem objectForKey:Question_KEY];
    [self enableBBI]; ////Error//////
    - (void)enableBBI {
    int count = [flashCards count];
    next.enabled = counter < count - 1 ? YES : NO;
    prev.enabled = counter > 0 ? YES : NO;
    flip.enabled = count > 0 ? YES : NO;
    Message was edited by: james_coleman01

    See xnav's suggestion, then add the following at the end of the file and move enableBBI inside:
    @implementation YourViewControllerName (PrivateMethods)
    - (void)enableBBI
    @end
    Using categories in this way is just a trick to simulate private methods in Objective-C. That way, you can define your methods where you want in the file without having to put them into the header file for all the world to see.
    You can create new categories for any class, including Cocoa classes like NSString, etc.
    Message was edited by: etresoft

  • How to set ResultSet not null?

    Hello !
    How can I set my ResultSet null? rs.next( ) is null.
    Thanks in advance.

    "...Hey, do you guys have an idea how to apply operator to method getTime() e.g rs.getTime("TimeOut") - rs.getTime("TimeIn")?..."
    It can't be done.
    One thing you should be checking is whether or not the last value returned from the result set was null, using the wasNull() method.
    If you're getting a NPE, it could be that one of the values you think you're getting back from the database is really null.
    Are you sure you want java.sql.Time? Not java.sql.Timestamp?
    Code it like this:
    java.sql.Timestamp timeIn = rs.getTimestamp("TimeIn");
    java.sql.Timestamp.timeOut = rs.getTimestamp("TimeOut");
    long duration = 0L;
    if ((timeIn != null) && (timeOut != null))
        long millisecondsIn = timeIn.getTime();
        long millisecondsOut = timeOut.getTime();
        duration = millisecondsOut - millisecondsIn;
        assert (duration >= 0L);
    }MOD

Maybe you are looking for

  • Error while starting the service

    Hi I am trying the web service example using j2ee from http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC3.html#wp124102 when I try to deply the service I am getting an exception as follows : Can any one help me out ? Thanks , Amol distribute: C:\

  • Mirror effect in web gallery

    Apologies for the newbie question. I am just creating my first web gallery from iPhoto. Other web galleries I have seen have a mirror/reflection effect on the photos. Mine is just the plain photo. Can anyone tell me how to set up mine to show the sam

  • HT201272 Why is the library button not appearing in iTunes 11.0.1?

    Followed steps as outlined in article, no button appears. I wish to have access to the content I paid for.

  • Library error (-50)

    I get an error message in i-tunes that says "library file cannot be saved. Unknown error occured (-50). How can I fix this.

  • AS2 Drag and Drop - Completion Response

    I am making a drag and drop alphabet learning game. There are 27 Movie Clips (letters) in total that are able to be dragged.  I've made it so that 12 of the Movie Clips will drop in a specific DropZone, while the rest will just snap back to their ori