public class ScriptConnection extends AbstractConnection
For configuration details and examples see overview page.
AbstractConnection.StatementCounter
counter
Constructor and Description |
---|
ScriptConnection(ConnectionParameters parameters)
Instantiates a new connection to JSR 223 scripting engine.
|
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.
|
commit, getDialectIdentifier, getExecutedStatementsCount, isReadonly, rollback, setDialectIdentifier, toString
public ScriptConnection(ConnectionParameters parameters)
parameters
- connection parameters.public void executeScript(Resource scriptContent, ParametersCallback parametersCallback) throws ScriptProviderException, ConfigurationException
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.ScriptProviderException
ConfigurationException
public void executeQuery(Resource queryContent, ParametersCallback parametersCallback, QueryCallback queryCallback) throws ScriptProviderException, ConfigurationException
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.ScriptProviderException
ConfigurationException
Connection.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.