Error message ResultSet.next not called

I am a student learning java and am currently working on an assignement where I need to write jdbc programs that connect to an oracle database. The error message that I am getting is:
ResultSet.next was not called.
I do not know why I am getting this message. I wrote a simpler program to try to find the error, but I still got it again. Here's the part of the program:
ResultSet rset = stmt.executeQuery ("SELECT billing_id_seq.NEXTVAL Next_SeqNumber "+
                         "FROM Dual");
int sequenceNumber=rset.getInt("Next_SeqNumber");
     while(rset.next()){
System.out.println(sequenceNumber);
Any ideas would be helpful. Thanks very much!

I am not really sure if it is okay to post the whole program on this message board, but here it is:
import java.sql.*;     //Import Java's JDBC classes
public class CalculateEnrollFinalGrades {
public static void main(String[] args) {
//Invoke the processEnrollRecords() method
     processEnrollRecords();
} //end main()
// The following method issues a SQL SELECT statement to the database that returns the section_id
// and student_id for ALL rows from the enrollment_copy table. For each row received back in the
// result set, a call should be made to the updateEnrollFinalGrade() method. See below for
// information about what the that method does and what arguments it takes.
public static void processEnrollRecords() {
try {
Class.forName("oracle.jdbc.driver.OracleDriver"); // Load the Oracle JDBC driver
catch (java.lang.ClassNotFoundException e) {
System.out.println(e.getMessage());
try {
//Create the connection and statement objects
     Connection conn= DriverManager.getConnection("jdbc:oracle:oci8:@", "STUDENT","LEARN");
     Statement stmt=conn.createStatement();
//Execute a query in the CTA database which returns section_id and student_id for all
//rows of the enrollment_copy table
     int sectId=0;
     int studId=0;
     String sqlQuery="SELECT section_id, student_id "+
               "FROM enrollment_copy";
     ResultSet rset= stmt.executeQuery(sqlQuery);
//For each record returned in the ResultSet object, pass
//the current connection object along with each section_id and student_id as
//arguments to a method called updateEnrollFinalGrade()
     //while(rset.next()){
     sectId=rset.getInt("section_id");
     studId=rset.getInt("student_id");
     updateEnrollFinalGrade(conn, sectId, studId);
     //}//close while
//Close all resources before the program ends
     //conn.close();      //should this be kept open???
     stmt.close();
     rset.close();
     return;
catch (java.sql.SQLException e) { 
System.out.println(e.getMessage());
} // end processEnrollRecords()
// calculate a final_grade for the specified student
// and section, and then it updates the enrollment_copy table with the final_grade.
private static void updateEnrollFinalGrade(Connection conn_p, int sectionId_p, int studentId_p) {
try {
     Connection conn= DriverManager.getConnection("jdbc:oracle:oci8:@", "STUDENT","LEARN");
     Statement stmt=conn.createStatement();
     //query returns one row which is the final grade for the course for a particular student id and section.
     String sqlQuery2= "SELECT "+
     "ROUND(SUM((SUM(g.numeric_grade))/(COUNT(g.grade_type_code))*(gtw.percent_of_final_grade/100))) finGrade "+
     "FROM grade g, grade_type_weight gtw "+
     "where g.section_id=gtw.section_id AND g.grade_type_code=gtw.grade_type_code "+
     "AND g.student_id=? "+
     "AND g.section_id=? "+
     "GROUP BY gtw.percent_of_final_grade";
     PreparedStatement pstmt=conn.prepareStatement(sqlQuery2);
     pstmt.setInt(1, studentId_p);
     pstmt.setInt(2, sectionId_p);     
     ResultSet rsetGrade=pstmt.executeQuery();
     int finalGrade=rsetGrade.getInt("finGrade");
//Once the final_grade has been calculated, use a different PreparedStatement object to
//store it in the related enrollment_copy record. You need to use a Prepared
//Statement
     String sqlUpdate=      "Update enrollment_copy "+
                    "SET final_grade=? "+
                    "WHERE student_id=? AND section_id=?";
     PreparedStatement pstmtUpdate=conn.prepareStatement(sqlUpdate);
     pstmtUpdate.setInt(1,finalGrade);
     pstmtUpdate.setInt(2,studentId_p);
     pstmtUpdate.setInt(3,sectionId_p);
     pstmtUpdate.executeUpdate();
     pstmt.close();
     pstmtUpdate.close();          
     stmt.close();
     rsetGrade.close();
     return;
} // end try block
catch (java.sql.SQLException e) { 
System.out.println(e.getMessage());
} //end updateEnrollFinalGrade()
} //end CalculateEnrollFinalGrades
Thanks very mush for your help.

Similar Messages

  • Iphone 3gs shows activation required, hocked up to iTunes and it is not recognized. Did the restore but just gets to the end and gives an error message it could not be restored, an unknown error occurred (-1). Can someone assist me in next steps please?

    iphone 3gs shows activation required, hooked up to iTunes and it is not recognized. Did the restore but just gets to the end and gives an error message it could not be restored, an unknown error occurred (-1). Can someone assist me in next steps please?

    Instructions to get the phone back working temporary.. till there is a real fix.
    1. turn off the phone
    2. fire up iTunes
    3. press and hold the home button, plug in the cable, hold till you get to see the recovery mode
    4. iTunes will the allow to choose restore the phone back to 5.0.1 ( no other choice)
    5. iTunes will then ask you to choose which previous backup to would like to recover.
    (note: please do not reboot your phone unless necessary, i realize at times after reboot, it goes back to sq1)

  • HT201210 im trying to restore my iphone 4 but getting error message as could not be contacted or temporarily unavailable plz help

    im trying to restore my iphone 4 but getting error message as could not be contacted or temporarily unavailable plz help

    Hey santhosh.pv,
    We have a few articles that can help troubleshoot the alert message in iTunes you see when you are trying to restore your iPhone 4. You can resolve many restore issues using the troubleshooting steps documented here:
    iOS: Resolving update and restore alert messages
    http://support.apple.com/kb/TS1275
    The next article is the companion of the more general article above. Follow the above article first. If, after following that article, the issue persists, continue with this article:
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/ts3694
    Cheers,
    David

  • ITunes error message / "iTunes could not connect to the music store...

    The past week, I have been having problems connecting to the iTunes music store. I purchased my ipod in 10/05 and have had no problems until recently. I keep receiving the following error message:
    "iTunes could not connect to the music store. Network connection was refused. Make sure your network settings are correct & network connection is active, then try again."
    I went onto the website, and checked various things. I uninstalled and reinstalled iTunes and the software, checked to see if I have any firewalls (none), checked to see if I have Windows XP service pack 2 (I have 1), and contacted my ISP (AOL). Help! I have AOL 8.0 dial up, and have had service with them for a couple of years now, so that is not an issue. Per AOL, I tried uninstalling AOL adapter and restarting my computer, and also deleting cookies and deleting files/all offline content, defaulted my security settings (they were the same), and reset web settings. I have restarted my computer, but am still having the same issues. I already contacted iTunes about this issue, and they sent me the same email twice, with the same instructions as their website, which I indicated I already tried numerous times. I have also checked my connections, and everything is fune. I try to access iTunes after logging into AOL.
    Thank you in advance to everybody that responds.
    Emily

    Thanks for the input. Unfortunately, I keep trying to do that, and have not been able to download for about a week. After contact customer support, I received the general "technical support" email, which is the same information found on the website. After replying to the email, which stated that I tried already tried the methods listed, I received the same email again. After replying to that email which included the previous threads, I received an email stating that the deparment I replied to does not handle technical issues. So, tonight, I re-emailed them with all of the threads and asked for an explanation of why I received technical emails if they do not respond to technical emails. It will be interesting to see how they respond, although it will probably be some general email. I sometimes respond to member service emails at my place of employment, so I know the procedure. The bottom line is that I should receive answers to my questions, even if the answer is something along these lines:
    "I am researching your problem, and will contact you within the next xx hours/business days with a resolution. We value you as a customer, and strive to maintain excellent customer support and satisfaction. Thank you for your patience."
    Or, a similar response. I know there is a general response library. And, I also know that if some body is unable to answer a question, as customer support, they should try utilize their resources. Basically, be a problem solver.

  • I want to de-install mac-excel test version and get the error message: you have not the privileges to de-install. Please login with the Mac-OS account you have installed mac-excel originally'. I don't know this account anymore. I am sysadm

    I want to de-install mac-excel test version and get the error message: 'You have not the privileges to de-install. Please login with the Mac-OS account you have installed mac-excel originally'. I don't know this account anymore. Possibly it does not exist anymore. anybody out there who can help ?

    Hi, I may suggest to activate the root account and try the uninstall process from that account. To do so, you have to:
    Go to System Preferences a open up the Users pane;
    On the left side of the pane, you shuold see Login Options;
    Enabled editing option clicking on the lock (it will ask your password);
    Once the pane is enabled, you should see something like Server Account Network (sorry my OS is in italian, so I don't exactly know the right translation), and right next to it a button;
    Click on that button, and a new pane shows up. Click on Open Directory Utility, and on the upper bar of OS X click on Edit;
    Select Enable Root Account (you can set a password, or not);
    Done that, you should log out and when the login window show up, type on the user field "root" and the password you choose;
    Theorically, from this account you will be able to unistall the application.
    After completing your task, I reccomend you to disable the root account, just by loggin in your personal account and repeating the steps I described before. Hope it helps

  • HT201364 I have a 2013 iMac, with OS X version 10.8.5.  Have been trying to download OS X Mavericks without success; error message "we could not complete your purchase, the product distribution file could not be verified, etc".  Please help; TQ

    I have a 2013 iMac, with OS X version 10.8.5.  Have been trying to download OS X version 10.9 (OS X Mavericks) without success; error message "we could not complete your purchase, the product distribution file could not be verified, etc".  Please help; TQ

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you boot, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • I installed the 829mb Apple software update on my 2011 Macbook Pro. Upon restart, it crashed.  Error message: Panic CPU  0 caller 0xffffff800064ba7b Unable to find driver for this platform \"acpi"\\n"@/sourcecache/xnu/xnu-1699.26.8/iokit/kernel/10platfor

    I installed the 829mb Apple software update on my 2011 Macbook Pro. Upon restart, it crashed.  It instructed me to hold power button to shut off and then press again to restart.  Same error message keeps coming up and computer won't boot to home screen.
    Error message:
    Panic CPU  0 caller 0xffffff800064ba7b Unable to find driver for this platform \"acpi"\\n"@/sourcecache/xnu/xnu-1699.26.8/iokit/kernel/10platform
    \"acpi"\\n"@/sourcecache/xnu/xnu-1699.26.8/iokit/kernel/10platformexpert.cpl:150 4
    Debugger called panic
    Kernal uuid a8ed611fb0f-3729-8392-e7a32c5e7d74
    THANKS FOR ANY HELP.
    ROBB

    Boot into Recovery by holding down the key combination command-R at the startup chime. Release the keys when you see a gray screen with a spinning dial.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with networks that require any kind of authentication other than a WPA or WPA2 Personal password.
    When the Mac OS X Utilities screen appears, follow the prompts to reinstall the Mac OS. You don't need to erase the boot volume, and you won't need your backup unless something goes wrong. If your Mac didn’t ship with Lion, you’ll need the Apple ID and password you used to upgrade, so make a note of those before you begin.
    Don't install the Thunderbolt update -- it's defective.

  • Itunes wont open at all, error message : quicktime was not found .... please reinstall ... i did that but no luck this only seems to have happened since the 10.4 update, im on windows 7 ..

    itunes wont open at all, error message : quicktime was not found .... please reinstall ... i did that but no luck this only seems to have happened since the 10.4 update, im on windows 7 ..

    Can you start QuickTime on your computer?
    You'll probably have to search for the Windows Installer Cleanup Utility and use it to remove QuickTime Player and iTunes. Then download and install the iTunes again.

  • Error Message: Number is not in external Interval (Testing Schedule)

    Hii ,
    Iam working on Stability study process. I have maintained stabity test with materiial (QS) & performed my test upto Initial test of Inspection lot. But when i click create Testing Scheudle in the Notification (QM02) , system asks for testing schedule data for
    Maintenane strategy, scheduling period.
    On clciking create testing schedule , system throws error message "Number is not in external interval". I have maintained all the prerequite setting on number range in following spro path stability study>testing schedule for stability study> Category--> no range.
    For Group ST   600000000- 6999999999 for Intenal & 70000000-7999999999 for external. But still iam facing with error message ""Number is not in external interval".  It throws message no "IP324" . Even I had cross checked with maintenance setting, but error message remains . How to resolve this issue?
    with regards,
    K.Lokesh.
    Edited by: Lokesh K on Mar 11, 2010 1:13 PM
    Edited by: Lokesh K on Mar 12, 2010 5:55 AM

    Hi Lokesh,
    did you actually enter a number ( i.e. 70000001)?
    Usually Stability studies are created using the external number range so that ringing names can be used for the studies:
    Example:
    Material: 000000000000000001  acetylsalicylic acid
    Stability study: ASA1
    I hope that this information proves usefull.
    Regards
    Isabelle

  • I get error message''one file not found'' when tring to sync Ipod Nano 6th gen to I tunes. Help

    I get error message''one file not found'' when tring to sync Ipod nano 6th gen to Itunes. Help

    See:
    iTunes cannot sync... apps not determined installed on...: Apple Support Communities
    installed apps could not be determined...: Apple Support Communities

  • I get error message iTunes could not sync calendars to iPhone because an error occurred while merging data

    I get error message iTunes could not sync calendars to iPhone because an error occurred while merging data on my wifes phone how do you correct problem without losing calendars info on phone.

    One thing that might help.
    1. open itunes preferences from the edit menu and click on the devices tab.
    2. check the box to disable syncing for iphones connected to itunes and click ok.
    3. Then click the button to reset sync history.
    4. Now click ok to close the preferences window.
    5. connect the iphone to itunes and go to the info tab.
    6. scroll to the bottom of the info page and check the box to replace the ical data on the iphone.
    7. then click apply on the bottom right of itunes.
    This will overwrite any events on the iphone, including any events that has become corrupted.
    Hope this helps

  • I am using Adobe Acrobat 9 Standard version in Windows 8.1 and when I try to create a .pdf file, I receive the following error message "Acrobat could not open "file name.log" because it is either not a supported file type or because the file has been dama

    I am using Adobe Acrobat 9 Standard version in Windows 8.1 and when I try to create a .pdf file, I receive the following error message "Acrobat could not open "file name.log" because it is either not a supported file type or because the file has been damaged.  To create a PDF document, go to the source application then print the document to .pdf"  I am going to the source application and printing the document to .pdf yet it's saving the file as a .log file.  After reinstalling the software, I initially didn't encounter this problem but on my second and third attempts to convert files to .pdf format, this error message reappeared.  How do I resolve this problem?

    I have a similar problem which i did not have before...and it exists only in some powerpoint files which i want to print as a pdf file...and i get the same message as above.
    the log says the bellow details...what's the problem and how can i resolve it? thanks.
    %%[ ProductName: Distiller ]%%
    %%[Page: 1]%%
    %%[Page: 2]%%
    Cambria not found, using Courier.
    %%[ Error: invalidfont; OffendingCommand: show ]%%
    Stack:
      %%[ Flushing: rest of job (to end-of-file) will be ignored ]%%

  • I can't sync my iphone to itunes i get this error message "Iphone could not sync because the sync failed to start" Help? both my computer windows and my phone are on the current versions of ios and itunes

    I can't sync my iphone to itunes i get this error message "Iphone could not sync because the sync failed to start" Help? both my computer windows and my phone are on the current versions of ios and itunes

    Hello lenmin,
    Thanks for using Apple Support Communities.
    To help resolve this issue where you're repeatedly prompted to authorize with your Apple ID in iTunes when syncing, please follow the directions in the article below.
    iTunes: Missing folder or incorrect permissions may prevent authorization - Apple Support
    Have a great weekend,
    Alex H.

  • I bought a Mac Book Pro retina display, Serial Number  C02J2****2, on 8/11/2012. Unfortunately, I am unable to download updates from the App store.Whenever I tried to download updates, it shows me an error message, "we could not complete your request. t

    I bought a Mac Book Pro retina display, Serial Number  C02J*****2, on 8/11/2012. Unfortunately, I am unable to download updates from the App store.Whenever I tried to download updates, it shows me an error message, "we could not complete your request. there is an error in the App Store. Try again later (100). Your Apple ID has been disabled, contact iTune support". However,the problem still persists even after my password has been successfully reset. What is is the error in the app store? I really need help to resolve this issue.
    Moreover,I also need help how to update to the mountain lion free of charge as my Mac pro is four(4) days old.
    Sincerely
    Asrat Kahsay
    N.B. I'M not exactly sure the operating system is "Mac OS X v10.7.x". However, I do know for sure it's Mac OS X v10.7.4
    <Edited by Host>

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    The OS X Mt Lion up-to-date program;
    http://www.apple.com/osx/uptodate/

  • After writing an html report on a floppy disk and removing it, labview shows an error message window: disk not present

    after writing an html report on a floppy disk and removing it, labview shows an error message window: disk not present.
    My pc is based on asus motherboard. Labview 7 and Windows 2000 sp4 installed.
    The error message continue also if i stop the application that generated report on a: .
    I've got this problem only on a pc: on other machines i don't have this problem (Labview only continues to access floppy but it doesn't show any window).
    Find below an example: first press the button to create a report on a: then remove the floppy, after 30-35 sec i've got the error message
    Attachments:
    prova.vi ‏55 KB

    Hi,
    I tried your vi: I don't get any error message after removing the disk but LV7 keeps on accessing the drive at regular intervals even if you stop the vi and close it!!! This is not supposed to happen.
    The only way to stop it is exit LV7.
    If you don't use the file dialog and you wire a full path, you don't get any problem.
    I also created a very simple vi that conditionally writes a text file on a: and I got the same behaviour.
    This problem occurs only with LV7, I tried the same examples in LV6.1 and everything was fine.
    If anybody wants to try I attach this simple example,
    Alberto
    Attachments:
    salva_testo1.vi ‏22 KB

Maybe you are looking for

  • How do you handle mixes of widescreen(16:9) and fullscreen(4:3)?

    Okay I have a native Fullscreen(4:3) (FS from now on) that has a widescreen (16:9) (WS from now on) mode. I am primarily using the widescreen mode for shooting but on my Panasonic using the WS mode disables the image stabilization. You have to flip b

  • Which Ram is better to go with?

    Hi, I was just wondering which Ram was better for my 2.2ghz intel core 2 duo 13 inch macbook which currently has 1 gb of ram. http://www.tigerdirect.ca/applications/searchtools/item-details.asp?EdpNo=435044 8&csid=ITD&body=MAIN OR http://eshop.macsal

  • Need tips for this approach

    function loadComplete(e:Event):void { removeChild(old_mc); addChild( DisplayObject(LoaderInfo(e.target).content) ); //trace(e.currentTarget.content.x); //trace(e.currentTarget.content.y); //trace(e.currentTarget.content.width); //trace(e.currentTarge

  • Mapping reuseability

    hi, We are having quite good number of XSLT transformations within our scope. How can we reuse the existing XSLT mappings defined under different software component versions? Lets say can we import XSLT transformation under SWCV1 and can we make use

  • What are the clusterable services in Sun App server 8.1?

    My guess is stateful session beans and entity beans. what about JMS and timer services? thanks, Nasrin