private static String getColumnsFromResultSetMetaData(ToolOptions options, ResultSetMetaData rsmd) throws SQLException {

        StringBuilder columnNames = new StringBuilder();

        int columnsNumber = rsmd.getColumnCount();

        for (int i = 1; i <= columnsNumber; i++) {
            if (i > 1) columnNames.append(",");
            if (options.getQuotedIdentifiers())
                columnNames.append("\"").append(rsmd.getColumnName(i)).append("\"");
            else
                columnNames.append(rsmd.getColumnName(i));
        }
        return columnNames.toString();
    }
@param options
@param rsmd
@return
@throws SQLException
src/main/java/org/replicadb/manager/util/SqlNames.java