下面的代码是从数据库中读取数据,然后放入工作空间中,工作空间中的数据集是表格的形式,用于记录站点和线路关系的,代码如下:
int i =1;
while(result.next()){
String line_no = result.getString("LINE_NO");
int is_up_down = result.getInt("IS_UP_DOWN");
int station_id = result.getInt("STATION_ID");
int label_no = result.getInt("LABEL_NO");
int city_id = result.getInt("CITY_ID");
int line_id = result.getInt("LINE_ID");
recordset.setInt32("SMUSERID", i);
recordset.setString("LINE_NO",line_no);
recordset.setInt32("IS_UP_DOWN",is_up_down);
recordset.setInt64("STATION_ID",station_id);
recordset.setInt32("LABEL_NO",label_no);
recordset.setInt64("CITY_ID",city_id);
recordset.setInt64("line_id",line_id);
recordset.moveNext();
i++;
}
这样写存入不到数据集中啊。