public String login(String uname, String pass) throws Exception {
        
        // 0. Variabel untuk koneksi
        String dbDriver = "com.mysql.jdbc.Driver";
        String dbUrl = "jdbc:mysql://localhost/kasir";
        String dbUser = "root";
        String dbPass = "";
        String login = "";
        
        byte[] bytesOfMessage = pass.getBytes("UTF-8");

        MessageDigest md = MessageDigest.getInstance("MD5");
        byte[] thedigest = md.digest(bytesOfMessage);
        
        
        // 1. Aktivasi driver database
        Class.forName(dbDriver);

        // 2. Connect ke database
        Connection conn = DriverManager.getConnection(dbUrl, dbUser, dbPass);
        
        String sql2 = "select *from admin where username = '" + uname + "' && password ='" + pass + "'";
        PreparedStatement ps2 = conn.prepareStatement(sql2);
        ResultSet rs = ps2.executeQuery();

        //List<Mahasiswa> mahasiswas = new ArrayList<Mahasiswa>();
        while(rs.next()) {
            login = rs.getString("username");
        }
        
        rs.close();
        conn.close();
        return login;
    }