Source:
public void addArtifactInstance(CorrelationAttributeInstance eamArtifact) throws EamDbException { checkAddArtifactInstanceNulls(eamArtifact); Connection conn = connect(); PreparedStatement preparedStatement = null; String tableName = EamDbUtil.correlationTypeToInstanceTableName(eamArtifact.getCorrelationType()); String sql = "INSERT INTO " + tableName + "(case_id, data_source_id, value, file_path, known_status, comment, object_id) " + "VALUES ((SELECT id FROM cases WHERE case_uid=? LIMIT 1), " + "(SELECT id FROM data_sources WHERE device_id=? AND case_id=? LIMIT 1), ?, ?, ?, ?, ?) " + getConflictClause(); try { preparedStatement = conn.prepareStatement(sql); if (!eamArtifact.getCorrelationValue().isEmpty()) { preparedStatement.setString(1, eamArtifact.getCorrelationCase().getCaseUUID()); preparedStatement.setString(2, eamArtifact.getCorrelationDataSource().getDeviceID()); preparedStatement.setInt(3, eamArtifact.getCorrelationDataSource().getCaseID()); preparedStatement.setString(4, eamArtifact.getCorrelationValue()); preparedStatement.setString(5, eamArtifact.getFilePath().toLowerCase()); preparedStatement.setByte(6, eamArtifact.getKnownStatus().getFileKnownValue()); if ("".equals(eamArtifact.getComment())) { preparedStatement.setNull(7, Types.INTEGER); } else { preparedStatement.setString(7, eamArtifact.getComment()); } preparedStatement.setLong(8, eamArtifact.getFileObjectId()); preparedStatement.executeUpdate(); } } catch (SQLException ex) { throw new EamDbException("Error inserting new artifact into artifacts table.", ex); } finally { EamDbUtil.closeStatement(preparedStatement); EamDbUtil.closeConnection(conn); } }

Target:
public void addArtifactInstance(CorrelationAttributeInstance eamArtifact) throws EamDbException { checkAddArtifactInstanceNulls(eamArtifact); Connection conn = connect(); PreparedStatement preparedStatement = null; String tableName = EamDbUtil.correlationTypeToInstanceTableName(eamArtifact.getCorrelationType()); String sql = "INSERT INTO " + tableName + "(case_id, data_source_id, value, file_path, known_status, comment, file_obj_id) " + "VALUES ((SELECT id FROM cases WHERE case_uid=? LIMIT 1), " + "(SELECT id FROM data_sources WHERE device_id=? AND case_id=? LIMIT 1), ?, ?, ?, ?, ?) " + getConflictClause(); try { preparedStatement = conn.prepareStatement(sql); if (!eamArtifact.getCorrelationValue().isEmpty()) { preparedStatement.setString(1, eamArtifact.getCorrelationCase().getCaseUUID()); preparedStatement.setString(2, eamArtifact.getCorrelationDataSource().getDeviceID()); preparedStatement.setInt(3, eamArtifact.getCorrelationDataSource().getCaseID()); preparedStatement.setString(4, eamArtifact.getCorrelationValue()); preparedStatement.setString(5, eamArtifact.getFilePath().toLowerCase()); preparedStatement.setByte(6, eamArtifact.getKnownStatus().getFileKnownValue()); if ("".equals(eamArtifact.getComment())) { preparedStatement.setNull(7, Types.INTEGER); } else { preparedStatement.setString(7, eamArtifact.getComment()); } preparedStatement.setLong(8, eamArtifact.getFileObjectId()); preparedStatement.executeUpdate(); } } catch (SQLException ex) { throw new EamDbException("Error inserting new artifact into artifacts table.", ex); } finally { EamDbUtil.closeStatement(preparedStatement); EamDbUtil.closeConnection(conn); } }