Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.out.println("SISTEM LOGIN");
- System.out.println("INSERIRE NOMEUTENTE");
- Scanner scan= new Scanner(System.in);
- String user= scan.nextLine();
- System.out.println("INSERIRE PASSWORD");
- String pass= scan.nextLine();
- try {
- boolean log = true;
- while(log) {
- //conn db
- Connection c = DriverManager.getConnection(url,usr,pswd);
- //creaz statement
- Statement ss = c.createStatement();
- //creaz codice sql
- String sql = " SELECT * FROM users WHERE user'" + user + "' && password='" + pass+ "' ";
- ResultSet res = ss.executeQuery(sql);
- if(res!=null) {
- System.out.println("LOGIN");
- log = false;
- }
- else System.out.println("LOGIN FAILE");
- }
- }
Add Comment
Please, Sign In to add comment