/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ram.bean;

/**
 *
 * @author Ram
 */
import java.sql.*;
public class LoginDao {

public static boolean validate(LoginBean bean){
boolean status=false;
try{
Connection con=ConnectionProvider.getCon();

PreparedStatement ps=con.prepareStatement(
    "select * from user where email=? and pass=?");

ps.setString(1,bean.getEmail());
ps.setString(2, bean.getPass());

ResultSet rs=ps.executeQuery();
status=rs.next();

}catch(Exception e){}

return status;

}
    public static void main(String[] args) {
        LoginBean obj=new LoginBean();
        obj.setEmail("ram@gmail.com");
        obj.setPass("ram");
        System.out.println(""+LoginDao.validate(obj));
    }
}
