日期:2014-05-20 浏览次数:20779 次
private ArrEvent record;
public ArrEvent getAllRecord() {
try{
String sql = "select * from " + tableNameEvent;
ResultSet rs = stmt.executeQuery(sql);
conn.commit();
conn.setAutoCommit(true);
ArrayList<Event> Event_list = new ArrayList<Event>();
while (rs.next()) {
Event_list.add(new Event(rs.getInt("EVENTCODE"), rs.getString("EVENTTYPE"), rs.getString("TITLE"), rs.getString("FACILITATOR"), rs.getString("LOCAION"), rs.getString("DATE"), rs.getString("TIME"), rs.getInt("MAX_PARTICIPANTS"), rs.getInt("NUM_PARTICIPANTS"), rs.getDouble("FEE")));
}
Event[] Arr_Event = new Event[Event_list.size()];
for (int i = 0; i < Event_list.size(); i++) {
Arr_Event[i] = Event_list.get(i);
}
record=new ArrEvent(Arr_Event,Event_list.size());
System.out.println(Arr_Event[0]);
}catch(SQLException ex){
}
return record;
}