Guest User

Untitled

a guest
Apr 13th, 2017
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package edu.pitt.is1017;
  7.  
  8. import javax.ejb.Stateless;
  9. import javax.persistence.EntityManager;
  10. import javax.persistence.PersistenceContext;
  11. import javax.persistence.Query;
  12.  
  13. @Stateless
  14. public class LoginFacade {
  15.     @PersistenceContext(unitName="INFSCI017")
  16.     private EntityManager em;
  17.    
  18.     public LoginFacade(){
  19.         super();
  20.     }
  21.    
  22.     public boolean checkLogin(String username, String password){
  23.         Query check = em.createQuery("SELECT username, password FROM user WHERE username = :login AND password = :password LIMIT 1;");
  24.         check.setParameter("login", username);
  25.         check.setParameter("password", password);
  26.        
  27.        
  28.        
  29.        
  30.         return false;
  31.     }
Add Comment
Please, Sign In to add comment