What is signup ?
Well, sign up simply means to register. It could be portal, newsletter or things the like. So when you visit and access anything for the first time, you need to sign up. Often, this is referred to as register. For instance, if you are new to Twitter, you need to sign up first.
To get help you can see the video.
Source code for signup page.
public SignUp() {
initComponents();
con = Connect.dbConnect();
middle();
}
public void middle(){
setLocationRelativeTo(null);
}
try{
if(jTextField1.getText().equals("") || jPasswordField1.getText().equals("") || jTextField2.getText().equals("")){
JOptionPane.showMessageDialog(null, "Field Must Not Empty !!!");
}else{
String sql = "select email from admin where email = ?";
pst = con.prepareStatement(sql);
pst.setString(1, jTextField2.getText());
rs = pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "This Email Already Exists...!!!");
}else{
String sql1 = "insert into admin(username,password,email,s_que,ans) values(?,?,?,?,?)";
pst = con.prepareStatement(sql1);
pst.setString(1, jTextField1.getText());
pst.setString(2, jPasswordField1.getText());
pst.setString(3, jTextField2.getText());
pst.setString(4, (String) jComboBox1.getSelectedItem());
pst.setString(5, jTextField3.getText());
pst.execute();
JOptionPane.showMessageDialog(null, "Successfully Created New Account...!!!");
}
}
}catch(HeadlessException | SQLException e){
JOptionPane.showMessageDialog(null, e);
}
Be First to Comment