protected Object getEntityFromFields() {
        Object obj = null;
        try {
            obj = resultClass.newInstance();
        } catch (InstantiationException e1) {
            e1.printStackTrace();
        } catch (IllegalAccessException e1) {
            e1.printStackTrace();
        }
        Field[] fields = null;
        fields = resultClass.getDeclaredFields();
        for (Field field : fields) {
            try {
                field.setAccessible(true);
                Class<?> type = field.getType();
                if (type.equals(int.class) || type.equals(Integer.class)) {
                    field.set(obj, rs.getInt(field.getName()));
                } else if (type.equals(String.class)) {
                    field.set(obj, rs.getString(field.getName()));
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return obj;
    }