Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Illegal Operation on empty resultset
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:
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...
0 · ·