1.
List list = new ArrayList();
try {
rs = ps.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
int columnCount = rsmd.getColumnCount();
while(rs.next()){
for(int i=1;i<=columnCount;i++){
//这里也可以放到MAP里面
String columnName = rsmd.getColumnName(i);
Object value = rs.getObject(i);
list.add(columnName+":"+value);
}
}
} catch (Exception e) {
// TODO: handle exception
}
while (rs.next())
{
rs.getString("seatno")
}
rs.close();