I am using CachedRowSetImpl to store data fetched from db. But I want to replace first two columns with one my own column . My code to fetch data is :
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());
So I want to remove columns event_id and user_label and put, as first, new column that contains those removed event_id and user_label.
Thank you!