.toString();
Statement stmt = null;
ResultSet rs = null;
String msgID = null;
Packet msg = null;
Exception myex = null;
try {
stmt = conn.createStatement();
rs = stmt.executeQuery( getAllMsgFromOldSQL );
while (rs.next()) {
msgID = rs.getString(1);
msg = new Packet(false);
msg.generateTimestamp(false);
msg.generateSequenceNumber(false);
InputStream is = null;
Blob blob = rs.getBlob(2);
is = blob.getBinaryStream();
msg.readPacket(is);
is.close();
String dstID = rs.getString(3);
long sessionID = rs.getLong(4);
long createdTS = rs.getLong(5);
try {
msgDAO.insert( conn, dstID, msg, null, null, sessionID,
createdTS, true );
} catch (BrokerException be) {
// If msg exist, just logged and continue
if (be.getStatusCode() == Status.CONFLICT) {
logger.log(Logger.WARNING, be.getMessage() + ": Ignore");
} else {
throw be;
}
}
msgToDst.put(msgID, dstID);
}
} catch (Exception e) {
myex = e;
String errorMsg = br.getKString(
BrokerResources.X_JDBC_UPGRADE_MESSAGES_FAILED,
(msg == null ? msgID : msg.getSysMessageID().toString()));
logger.logStack(Logger.ERROR, errorMsg, e);
throw new BrokerException(errorMsg, e);
} finally {
Util.close( rs, stmt, null, myex );
}