sql.append("insert into items ");
sql.append("(item_id, project_id, active, ");
sql.append("status, created, expires) values ");
sql.append("(?, ?, ?, ?, now(), ?) ");
QueryParser qp = new QueryParser(sql.toString());
qp.addPreparedStmtElementDefinition(item.getItemId());
qp.addPreparedStmtElementDefinition(item.getProjectId());
qp.addPreparedStmtElementDefinition(item.isActive());
qp.addPreparedStmtElementDefinition(QueryParserElement.INT, item
.getStatus() <= 0 ? null : item.getStatus());
qp.addPreparedStmtElementDefinition(QueryParserElement.TIMESTAMP, item
.getExpires());
if (connection != null) {
qp.setConnection(connection);
}
try {
Configuration.getConnectionPool().executeInsertOrUpdate(qp);
} catch (SQLException e) {