for (int i = 0; i < req.getProcessData().size(); i++) {
try {
com = con.prepareStatement("INSERT INTO rawdatamachineprocess "
+ "(uri, memoryused, percentcpu, id, utcdatetime, threads, openfiles, startedat) "
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?);");
com.setString(1, Utility.truncate(req.getProcessData().get(i).getUri(), MAXTEXT));
if (req.getProcessData().get(i).getBytesusedMemory() == null) {
com.setNull(2, java.sql.Types.BIGINT);
} else {
com.setLong(2, req.getProcessData().get(i).getBytesusedMemory().longValue());
if (req.getProcessData().get(i).getPercentusedCPU() == null) {
com.setNull(3, java.sql.Types.INTEGER);
} else {
com.setLong(3, req.getProcessData().get(i).getPercentusedCPU().intValue());
req.getProcessData().get(i).setId(id.toString());
com.setString(4, id.toString());
if (req.getProcessData().get(i).getTimestamp() == null) {
com.setLong(5, now);
} else {
com.setLong(5, req.getProcessData().get(i).getTimestamp().getTimeInMillis());
if (req.getProcessData().get(i).getNumberofActiveThreads() == null) {
com.setNull(6, java.sql.Types.BIGINT);
} else {
com.setLong(6, req.getProcessData().get(i).getNumberofActiveThreads());
com.setLong(7, req.getProcessData().get(i).getOpenFileHandles());