Package scriptella.driver.text
Class AbstractTextConnection
java.lang.Object
scriptella.spi.AbstractConnection
scriptella.driver.text.AbstractTextConnection
- All Implemented Interfaces:
Connection
- Direct Known Subclasses:
CsvConnection,ShellConnection,TextConnection,VelocityConnection
Base class for Text/CSV connections.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Nested Class Summary
Nested classes/interfaces inherited from class scriptella.spi.AbstractConnection
AbstractConnection.StatementCounter -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of theencodingconnection property.static final StringName of theeolconnection property.static final StringName of theflushconnection property.static final StringPrefix for properties containing a definition of the column format.static final StringName of thenull_stringconnection property.static final StringName of theskip_linesconnection property.static final StringName of thetrimconnection property.Fields inherited from class scriptella.spi.AbstractConnection
counter -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFor testing only.protectedAbstractTextConnection(DialectIdentifier dialectIdentifier, TextConnectionParameters parameters) protectedAbstractTextConnection(DialectIdentifier dialectIdentifier, ConnectionParameters parameters) Initializes a text connection using specified properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected TextConnectionParametersprotected ReaderCreates a new reader for input.protected WriterCreates a new writer to send output to.Methods inherited from class scriptella.spi.AbstractConnection
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface scriptella.spi.Connection
close, executeQuery, executeScript
-
Field Details
-
ENCODING
Name of theencodingconnection property. Specifies charset encoding in text files.- See Also:
-
EOL
Name of theeolconnection property. EOL suffix. Default value is \n.- See Also:
-
TRIM
Name of thetrimconnection property. Value oftruespecifies that the leading and trailing whitespaces should be omitted.- See Also:
-
FLUSH
Name of theflushconnection property. Value oftruespecifies that the outputted content should flushed immediately after the <script> element completes.- See Also:
-
SKIP_LINES
Name of theskip_linesconnection property. The number of lines to skip before start reading. Default value is 0 (no lines are skipped).Only valid for <query> elements.
- See Also:
-
NULL_STRING
Name of thenull_stringconnection property. If set, specifies value of a string token to be parsed/formatted as Javanullliteral.- See Also:
-
FORMAT_PREFIX
Prefix for properties containing a definition of the column format.- See Also:
-
-
Constructor Details
-
AbstractTextConnection
protected AbstractTextConnection()For testing only. -
AbstractTextConnection
protected AbstractTextConnection(DialectIdentifier dialectIdentifier, ConnectionParameters parameters) Initializes a text connection using specified properties.- Parameters:
dialectIdentifier-parameters-
-
AbstractTextConnection
protected AbstractTextConnection(DialectIdentifier dialectIdentifier, TextConnectionParameters parameters)
-
-
Method Details
-
newOutputWriter
Creates a new writer to send output to.- Returns:
- writer for output.
- Throws:
IOException- if IO error occured.
-
newInputReader
Creates a new reader for input.- Returns:
- reader for input.
- Throws:
IOException- if IO error occured.
-
getConnectionParameters
-