如何用一列替换CachedRowSet的前两列?

时间:2013-11-08 22:47:10

标签: java jdbc cachedrowset

我正在使用CachedRowSetImpl来存储从db获取的数据。 但我想用一个我自己的列替换前两列。 我获取数据的代码是:

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 个答案:

没有答案