|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscriptella.spi.AbstractConnection
scriptella.driver.text.AbstractTextConnection
scriptella.driver.csv.CsvConnection
public class CsvConnection
Represents a connection to CSV file.
For configuration details and examples see overview page.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class scriptella.spi.AbstractConnection |
|---|
AbstractConnection.StatementCounter |
| Field Summary | |
|---|---|
static java.lang.String |
HEADERS
Name of the headers connection property. |
static java.lang.String |
NULL_STRING
Name of the null_string connection property. |
static java.lang.String |
QUOTE
Name of the quote connection property. |
static java.lang.String |
SEPARATOR
Name of the separator connection property. |
| Fields inherited from class scriptella.driver.text.AbstractTextConnection |
|---|
encoding, ENCODING, eol, EOL, flush, FLUSH, SKIP_LINES, skipLines, trim, TRIM, url |
| Fields inherited from class scriptella.spi.AbstractConnection |
|---|
counter |
| Constructor Summary | |
|---|---|
CsvConnection(ConnectionParameters parameters)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the connection and releases all related resources. |
void |
executeQuery(Resource queryContent,
ParametersCallback parametersCallback,
QueryCallback queryCallback)
Executes a query specified by its content. |
void |
executeScript(Resource scriptContent,
ParametersCallback parametersCallback)
Executes a script specified by its content. |
protected CSVWriter |
getOut()
|
| Methods inherited from class scriptella.driver.text.AbstractTextConnection |
|---|
getEncoding, getEol, getUrl, isTrim, newInputReader, newOutputWriter |
| Methods inherited from class scriptella.spi.AbstractConnection |
|---|
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SEPARATOR
separator connection property.
The delimiter to use for separating entries when reading from or writing to files.
public static final java.lang.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 java.lang.String HEADERS
headers connection property.
true means the first line contains headers. Default value is true.
Only valid for <query> elements.
public static final java.lang.String NULL_STRING
null_string connection property.
If set, specifies value of a string token to be parsed as Java null literal.
| Constructor Detail |
|---|
public CsvConnection(ConnectionParameters parameters)
| Method Detail |
|---|
public void executeScript(Resource scriptContent,
ParametersCallback parametersCallback)
throws ProviderException
ConnectionscriptContent may be used as a key for caching purposes, i.e.
provider may precompile scripts and use compiled versions for subsequent executions.
Please note that only inline text resources
can be safely cached.
scriptContent - script content. Cannot be null.parametersCallback - callback to get parameter values. Cannot be null.
ProviderException - if script execution failed.
public void executeQuery(Resource queryContent,
ParametersCallback parametersCallback,
QueryCallback queryCallback)
throws ProviderException
Connection
queryContent - query content. Cannot be null.parametersCallback - callback to get parameter values. Cannot be null.queryCallback - callback to call for each result set element produced by this query. Cannot be null.
ProviderException - if query execution failed.Connection.executeScript(scriptella.spi.Resource,scriptella.spi.ParametersCallback)protected CSVWriter getOut()
public void close()
throws ProviderException
Connection
ProviderException - if a critical failure occured.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||