Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String userlogin;
- String userpassword;
- userlogin = userloginfield.getText();
- userpassword = userpassfield.getText();
- userloginfield.setText("");
- userpassfield.setText("");
- try{
- SqlHandler sh = new SqlHandler("databas");
- ResultSet rs = sh.query("select password from user1337.T1 where username='"+userlogin+"'");
- if(rs.next()){
- String pass = rs.getString("password");
- if(pass.equals(userpassword)){
- textarea1.setText("Success!");
- }else{
- textarea1.setText("Failed!");
- }
- }
- sh.close();
- } catch (Exception ex){
- ex.printStackTrace();
- System.out.println("Error!");
- }
Add Comment
Please, Sign In to add comment