java csv semi colon issue
<p>I have to modify a program. This program creates csv file with columns in database like this : </p>

<pre><code>    csvBuilder.initCsvFile();
    csvBuilder.createRow(headers.toArray(new String[headers.size()]));
while (resultSet.next()) {
        String[] row = new String[resultSetColumnCount];
        int columnIndex = 1;
        while (columnIndex &lt;= resultSetColumnCount) {
            Object object = resultSet.getObject(columnIndex);
            if (object == null) {
                row[columnIndex - 1] = "";
            } else {
                row[columnIndex - 1] = object.toString();
            }
            columnIndex++;
        }
        csvBuilder.createRow(row);
    }
</code></pre>

<p><strong>initCsvFile method</strong>:</p>

<pre><code>public void initCsvFile() {
    try {
        writer = new CSVWriter(new FileWriter(filePath), ';', CSVWriter.NO_QUOTE_CHARACTER);
    } catch (IOException e) {
        logger.error("CsvBuilder : error when creating {}", filePath, e);
        throw new CsvException("Error when creating the file : " + filePath, e);
    }
}
</code></pre>

<p><strong>createRow method:</strong> </p>

<pre><code>public void createRow(String[] row) {
    writer.writeNext(row);
}
</code></pre>

<p>The problem is that, i have some data that includes the separator ';' like shown below,</p>

<pre><code>id col1     col2   
1   US     United;States
</code></pre>

<p>Unfortunately, the csv file separates United and states in two . How can I check the content of resultSet and escape the separator  without modify all program to get United;states in one row? </p>

<p>Thanks for your help</p>