Package scriptella.driver.json
Class JsonConnection
java.lang.Object
scriptella.spi.AbstractConnection
scriptella.driver.json.JsonConnection
- All Implemented Interfaces:
Connection
Streaming input or lazily opened output; construction performs no I/O.
-
Nested Class Summary
Nested classes/interfaces inherited from class scriptella.spi.AbstractConnection
AbstractConnection.StatementCounter -
Field Summary
Fields inherited from class scriptella.spi.AbstractConnection
counter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the connection and releases all related resources.voidcommit()Commits a current transaction (if any).voidexecuteQuery(Resource query, ParametersCallback parameters, QueryCallback callback) Executes a query specified by its content.voidexecuteScript(Resource script, ParametersCallback parameters) Executes a script specified by its content.Optional live progress counter.protected Readerprotected Writervoidrollback()Rolls back a current transaction (if any).Methods inherited from class scriptella.spi.AbstractConnection
getDialectIdentifier, getExecutedStatementsCount, isExecutedStatementsCountSupported, isReadonly, 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
-
JsonConnection
-
-
Method Details
-
getProgressCounter
Description copied from interface:ConnectionOptional live progress counter. Called on the execution thread only. Return a stable in-memory counter updated with the same semantics asConnection.getExecutedStatementsCount(), or null if unavailable. The reporter reads only its volatile value, never this connection. The counter must remain valid after close. Existing providers need not implement this method. -
newInputReader
- Throws:
IOException
-
executeQuery
Description copied from interface:ConnectionExecutes a query specified by its content.- Parameters:
query- query content. Cannot be null.parameters- callback to get parameter values. Cannot be null.callback- callback to call for each result set element produced by this query. Cannot be null.- See Also:
-
executeScript
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:
script- script content. Cannot be null.parameters- callback to get parameter values. Cannot be null.
-
newOutputWriter
- Throws:
IOException
-
commit
public void commit()Description copied from interface:ConnectionCommits a current transaction (if any).Throwing an error during commit phase cause
rollback.- Specified by:
commitin interfaceConnection- Overrides:
commitin classAbstractConnection
-
rollback
public void rollback()Description copied from interface:ConnectionRolls back a current transaction (if any).- Specified by:
rollbackin interfaceConnection- Overrides:
rollbackin classAbstractConnection
-
close
public void close()Description copied from interface:ConnectionCloses the connection and releases all related resources.
-