Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Illegal Operation on empty resultset Posted by Yomel on 24 Jan 2011 at 10:25 AM
Hi there,
I am having a problem with my s/w...continuously having this error "Illegal Operation on empty ResultSet". Here is the piece of codes where it is showing this error:

Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/UOM","root","");

PreparedStatement statement1 = con.prepareStatement
("SELECT All_Staff_Details.Position FROM Logins, All_Staff_Details WHERE Logins.Username = '" +jTextField2.getText()+ "' AND Logins.Staff_Student_ID = All_Staff_Details.Staff_ID LIMIT 1");

ResultSet result1 = statement1.executeQuery();
pos = result1.getString(1);

---------------------
I keep my databases on EasyPHP...and i use eclipse to connect to the databases from there. I run the sql in EasyPHP and it is return the result successfully. But when i put it in the code above in eclipse it is giving me empty result...so i don't understand how it run well returning the result on easyPHP when on eclipse it is saying emtpy resultSet!
Can anyone help me please...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.