public AuthHeader getAuthHeaderByToken(String token){
		
		AuthHeader ah=null;
		
		Connection con = null;
        Statement stmt = null;
        try {
            DBconnection dbCon = new DBconnection();
            Class.forName(dbCon.getJDBC_DRIVER());

            con = DriverManager.getConnection(dbCon.getDATABASE_URL(),
                    dbCon.getDB_USERNAME(), dbCon.getDB_PASSWORD());

            stmt = con.createStatement();
            ResultSet rs = stmt.executeQuery("Select * From auth_tokens where auth_token='"+token+"'");
            if (rs.next()) {
                ah = new AuthHeader();
                ah.setCust_id(rs.getInt(1));
                ah.setToken(rs.getString(2));
              
                Timestamp timestamp=rs.getTimestamp(3);
                Date date=new Date(timestamp.getTime());
               
                ah.setAuth_date(date);
            }
        } catch (SQLException | ClassNotFoundException ex) {
            System.err.println("Caught Exception: " + ex.getMessage());
        } finally {
            try {
                if (stmt != null) {
                    stmt.close();
                }
                if (con != null) {
                    con.close();
                }
            } catch (SQLException ex) {
                System.err.println("Caught Exception: " + ex.getMessage());
            }
        }
        return ah;
		
	}