Как заменить первые два столбца CachedRowSet одним столбцом?

Я использую CachedRowSetImpl для хранения данных, извлеченных из базы данных. Но я хочу заменить первые два столбца одним собственным. Мой код для извлечения данных:

cachedRowSet = new CachedRowSetImpl();
                    cachedRowSet.setType(ResultSet.TYPE_SCROLL_INSENSITIVE);
                    cachedRowSet.setConcurrency(ResultSet.CONCUR_UPDATABLE);
                    cachedRowSet.setUrl(connection.getDbUrl());
                    cachedRowSet.setUsername(connection.getUserName());
                    cachedRowSet.setPassword(connection.getPassword());
                    workerThread.setProgressValue(40);
cachedRowSet.setCommand("select e.event_id,e.user_label,a.attempt_id,a.preferred,a.duration,a.location from event e,attempt a where e.user_label=? and e.start_time=? and e.end_time=? and e.duration_min=? and e.duration_max=? and e.event_id=a.event_id");
                cachedRowSet.setString(1, event.getUserLabel());
                cachedRowSet.setTimestamp(2, event.getStartTime());
                cachedRowSet.setTimestamp(3, event.getEndTime());
                cachedRowSet.setTimestamp(4, event.getDurationMin());
                cachedRowSet.setTimestamp(5, event.getDurationMax());

Поэтому я хочу удалить столбцы event_id и user_label и поставить, как первый, новый столбец, в котором содержатся удаленные столбцы event_id и user_label.

Спасибо!

0 ответов

Другие вопросы по тегам