public class VelocityConnection extends AbstractTextConnection
AbstractConnection.StatementCounter
ENCODING, EOL, FLUSH, FORMAT_PREFIX, NULL_STRING, SKIP_LINES, TRIM
counter
Constructor and Description |
---|
VelocityConnection(ConnectionParameters parameters)
Instantiates a velocity connection.
|
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.
|
getConnectionParameters, newInputReader, newOutputWriter
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toString
public VelocityConnection(ConnectionParameters parameters)
parameters
- connection parameters.public void executeScript(Resource scriptContent, ParametersCallback parametersCallback) throws ProviderException
scriptContent may be used as a key for caching purposes, i.e. provider may precompile scripts and use compiled versions for subsequent executions.
This method is synchronized to to prevent multiple threads from working with the same writer. Additionally single velocityEngine and context adapter instances are used.
scriptContent
- script content.parametersCallback
- callback to get parameter values.ProviderException
- if script execution failed.public void executeQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) throws ProviderException
queryContent
- query content.parametersCallback
- callback to get parameter values.queryCallback
- callback to call for each result set element produced by this query.ProviderException
- if query execution failed.executeScript(scriptella.spi.Resource,scriptella.spi.ParametersCallback)
public void close() throws ProviderException
ProviderException
- if a critical failure occured.Copyright © Copyright 2006-2019 The Scriptella Project Team.