Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- Class.forName("com.mysql.jdbc.Driver");
- con =DriverManager.getConnection("jdbc:mysql://localhost/dbperpustakaan_10114287_10114299_10114336","root","");
- sql ="select * from tlogin where username='" + tnama.getText() + "'" + "AND password='" + tpas.getText() + "'" ;
- stat = con.createStatement();
- res = stat.executeQuery(sql);
- int baris = 0;
- while (res.next()){
- baris =res.getRow();
- }
- if(baris==1){
- JOptionPane.showMessageDialog(null, "Login Berhasil");
- menuutama mu = new menuutama();
- mu.setVisible(true);
- this.setVisible(false);
- }else{
- JOptionPane.showMessageDialog(null, "Usename atau Password anda Salah/Tidak Ditemukan silahkan Mendaftar");
- }
- } catch (Exception e) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement