public class TextConnection extends AbstractTextConnection
For configuration details and examples see overview page.
AbstractConnection.StatementCounter
ENCODING, EOL, FLUSH, FORMAT_PREFIX, NULL_STRING, SKIP_LINES, TRIM
counter
Modifier | Constructor and Description |
---|---|
protected |
TextConnection()
For testing purposes only.
|
|
TextConnection(ConnectionParameters parameters) |
Modifier and Type | Method and Description |
---|---|
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 void |
initOut()
Lazily initializes script writer.
|
getConnectionParameters, newInputReader, newOutputWriter
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toString
protected TextConnection()
public TextConnection(ConnectionParameters parameters)
public void executeScript(Resource scriptContent, ParametersCallback parametersCallback) throws ProviderException
Connection
scriptContent 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.protected void initOut()
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)
public void close() throws ProviderException
Connection
ProviderException
- if a critical failure occured.Copyright © Copyright 2006-2019 The Scriptella Project Team.