Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean login(String username, String password) throws RemoteException {
- boolean b = false;
- try {
- Connection db_con = databaseConnection();
- Statement stmt = db_con.createStatement();
- String sql = "SELECT * FROM books_db.user WHERE user_id = '" + username + "' and status = 'active'";
- ResultSet rs=stmt.executeQuery(sql);
- String checkusername = rs.getString(1);
- String checkpassword = rs.getString(2);
- if (checkusername.equals(username) && checkpassword.equals(password)) {
- b = true;
- } else {
- b = false;
- }
- } catch (Exception e) {
- }
- return b;
- }
- public boolean login(String username, String password) throws RemoteException;
- Message impl = (Message) myRegistry.lookup("asd");
- String u = "20160001";
- String p = "p";
- boolean r = impl.login(u, p);
- if (r == true) {
- System.out.println("success");
- } else {
- System.out.println("fail");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement