What is login ?
Alternatively referred to as a sign in, a login or logon is a set of credentials used to gain access to an area that requires proper authorization. Logins are used to gain access to and control of computer networks, and bulletin boards, as well as other services and devices. Today, most logins consist of both a username and password.
To get help you can see the video.
Source code for login page.
Connection con = null;
ResultSet rs;
PreparedStatement pst;
public Login() {
initComponents();
con = Connect.dbConnect();
middle();
}
public void middle(){
setLocationRelativeTo(null);
}
try{
String sql = "select email,password from admin where email=? and password=? ";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField1.getText());
pst.setString(2, jPasswordField1.getText());
rs = pst.executeQuery();
if(rs.next()){
dispose();
new Home().setVisible(true);
}else{
JOptionPane.showMessageDialog(null, "Wrong Information...!!!");
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
Be First to Comment