public class CsvConnection extends AbstractTextConnection
For configuration details and examples see overview page.
AbstractConnection.StatementCounter| Modifier and Type | Field and Description |
|---|---|
static String |
ESCAPE
Name of the
escape connection property. |
static String |
HEADERS
Name of the
headers connection property. |
protected static Logger |
LOG |
static String |
QUOTE
Name of the
quote connection property. |
static String |
QUOTEALL
Name of the
quoteall connection property. |
static String |
SEPARATOR
Name of the
separator connection property. |
ENCODING, EOL, FLUSH, FORMAT_PREFIX, NULL_STRING, SKIP_LINES, TRIMcounter| Constructor and Description |
|---|
CsvConnection(ConnectionParameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
executeQuery(Resource queryContent,
ParametersCallback parametersCallback,
QueryCallback queryCallback) |
void |
executeScript(Resource scriptContent,
ParametersCallback parametersCallback) |
protected CsvConnectionParameters |
getConnectionParameters() |
protected CSVWriter |
getOut() |
protected CsvQuery |
newCsvQuery(CSVReader csvReader,
PropertiesSubstitutor ps)
Template factory method to instantiate query handlers.
|
newInputReader, newOutputWritercommit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toStringprotected static final Logger LOG
public static final String SEPARATOR
separator connection property.
The delimiter to use for separating entries when reading from or writing to files.public static final String QUOTE
quote connection property.
The character to use for quoted elements when reading from or writing to files. Use empty string to suppress
quoting.public static final String ESCAPE
escape connection property.
The character to use for escaped elements when writing to files. Use empty string to suppress
escaping.public static final String HEADERS
headers connection property.
true means the first line contains headers. Default value is true.
Only valid for <query> elements.
public static final String QUOTEALL
quoteall connection property.
false means only elements with the quote or escape character are quoted.
Default value is true.public CsvConnection(ConnectionParameters parameters)
public void executeScript(Resource scriptContent, ParametersCallback parametersCallback) throws ProviderException
ProviderExceptionpublic void executeQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) throws ProviderException
ProviderExceptionprotected CSVWriter getOut()
protected CsvQuery newCsvQuery(CSVReader csvReader, PropertiesSubstitutor ps)
csvReader - CSV reader to use for parsing.ps - properties substitutor.public void close()
throws ProviderException
ProviderExceptionprotected CsvConnectionParameters getConnectionParameters()
getConnectionParameters in class AbstractTextConnectionCopyright © 2006–2019. All rights reserved.