private static Patient getPatient(Patient bean, PreparedStatement stmt, ResultSet rs, int numOfObject) throws SQLException{
		
		if(bean.getPid()!=0)
			stmt.setInt(1, bean.getPid());
		else if(bean.getPhone()!=null){
			stmt.setString(1, bean.getFirstName());
			stmt.setString(2, bean.getLastName());
			stmt.setString(3, bean.getPhone());
		}
		else{
			stmt.setString(1, bean.getFirstName());
			stmt.setString(2, bean.getLastName());
		}
		
		rs = stmt.executeQuery();
		
		if (rs.next()) {
			Patient newBean = new Patient();
			newBean.setPid(rs.getInt("pid"));
			newBean.setFirstName(rs.getString("firstname"));
			newBean.setLastName(rs.getString("lastname"));
			newBean.setDob(rs.getDate("dob"));
			newBean.setPrimaryDoc(rs.getString("primarydoc"));
			newBean.setPhone(rs.getString("phone"));
			newBean.setAddress(rs.getString("address"));
			newBean.setCity(rs.getString("city"));
			newBean.setState(rs.getString("state"));
			newBean.setZip(rs.getString("zip"));
			numOfObject++;
			return newBean;
		} else {
			System.out.println("unable to retrieve patient info");
			return null;
		}
	}