The problem appears in openConnection()
.
I've tried all solutions and they didn't work. Can someone save me and write the solution in details that I can understand it?
package cabinet.database;
import cabinet.Admin;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class logincc {
Statement st;
public boolean islogin(Admin ad)throws SQLException{
st= Connection.openConnection().createStatement();
ResultSet res= st.executeQuery("select*from mote de passe where username ='"+ad.getUsername()+"'and password='"+ ad.getPassword()+"'" );
if (res.next())
return true;
return false;
}
}