static Object rsToObject(ResultSet rs, Class model) {
        Object object = null;
        try {
            if (rs.next()) {
                Object obj = model.newInstance();
                Field[] fields = getFields(model);
                for (int i = 0; i < rs.getMetaData().getColumnCount() && i < fields.length; i++) {
                    fields[i].set(obj, rs.getObject(i+1));
                }
                object = obj;
            }
        } catch (InstantiationException | IllegalAccessException | SQLException ex) {
            Logger.getLogger(DbUtils.class.getName()).log(Level.SEVERE, null, ex);
        }
        return object;
    }