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 · ·