Package scriptella.driver.shell
Class ShellConnection
java.lang.Object
scriptella.spi.AbstractConnection
scriptella.driver.text.AbstractTextConnection
scriptella.driver.shell.ShellConnection
- All Implemented Interfaces:
Connection
Represents a shell script connection.
For configuration details and examples see overview page.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Nested Class Summary
Nested classes/interfaces inherited from class scriptella.spi.AbstractConnection
AbstractConnection.StatementCounter -
Field Summary
Fields inherited from class scriptella.driver.text.AbstractTextConnection
ENCODING, EOL, FLUSH, FORMAT_PREFIX, NULL_STRING, SKIP_LINES, TRIMFields inherited from class scriptella.spi.AbstractConnection
counter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the connection and releases all related resources.voidexecuteQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) Executes a query specified by its content.voidexecuteScript(Resource scriptContent, ParametersCallback parametersCallback) Executes a script specified by its content.protected ShellConnectionParametersprotected voidLazily initializes script writer.Methods inherited from class scriptella.driver.text.AbstractTextConnection
newInputReader, newOutputWriterMethods 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
getUpdateCount
-
Constructor Details
-
ShellConnection
-
-
Method Details
-
executeScript
public void executeScript(Resource scriptContent, ParametersCallback parametersCallback) throws ProviderException Description copied from interface:ConnectionExecutes a script specified by its content.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 resourcescan be safely cached.- Parameters:
scriptContent- script content. Cannot be null.parametersCallback- callback to get parameter values. Cannot be null.- Throws:
ProviderException- if script execution failed.
-
initScriptExecutor
protected void initScriptExecutor()Lazily initializes script writer. -
executeQuery
public void executeQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) throws ProviderException Description copied from interface:ConnectionExecutes a query specified by its content.- Parameters:
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.- Throws:
ProviderException- if query execution failed.- See Also:
-
close
Description copied from interface:ConnectionCloses the connection and releases all related resources.- Throws:
ProviderException- if a critical failure occured.
-
getConnectionParameters
- Overrides:
getConnectionParametersin classAbstractTextConnection
-