public static List<Event> getEvents(int idFlow){
Connection con = connect();
Statement stm = null;
List<Event> events = new ArrayList<Event>();
ResultSet result;
try {
stm = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
String query = "SELECT id_event,event_name FROM events WHERE id_flow = " + idFlow;
log.info(query);
result = stm.executeQuery(query);
while(result.next()){
events.add(new Event(result.getInt(1),result.getString(2)));
}
result.close();
} catch(SQLException er) {
log.info("SELECT is wrong!");
log.info(er.getMessage());
} finally {
JdbcConnect.Close(con);
}
return events;
}