ResultSet rs = ps.executeQuery();
while (rs.next()) {
Event event = new EventImpl();
event.setMessageID(messageID);
String description = rs.getString(1);
event.setDescription(description);
InputStream is = rs.getBinaryStream(2);
if (is != null)
{
Throwable throwable = new Throwable();
throwable.initCause((Throwable) SerializationUtility.deserialize(is));
event.setThrowable(throwable);
}
long time = rs.getLong(3);
Calendar calendar = new GregorianCalendar();
calendar.setTimeInMillis(time);
event.setTimeStamp(calendar);
boolean isErrorMessage = rs.getBoolean(4);
event.setError(isErrorMessage);
InputStream is2 = rs.getBinaryStream(5);
if (is2 != null)
{
event.setXMLString((String)SerializationUtility.deserialize(is2));
}
events.add(event);
}
ps.close();