Class JsonConnection

java.lang.Object
scriptella.spi.AbstractConnection
scriptella.driver.json.JsonConnection
All Implemented Interfaces:
Connection

public class JsonConnection extends AbstractConnection
Streaming input or lazily opened output; construction performs no I/O.
  • Constructor Details

  • Method Details

    • getProgressCounter

      public AbstractConnection.StatementCounter getProgressCounter()
      Description copied from interface: Connection
      Optional live progress counter. Called on the execution thread only. Return a stable in-memory counter updated with the same semantics as Connection.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

      protected Reader newInputReader() throws IOException
      Throws:
      IOException
    • executeQuery

      public void executeQuery(Resource query, ParametersCallback parameters, QueryCallback callback)
      Description copied from interface: Connection
      Executes 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

      public void executeScript(Resource script, ParametersCallback parameters)
      Description copied from interface: Connection
      Executes 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 resources can be safely cached.

      Parameters:
      script - script content. Cannot be null.
      parameters - callback to get parameter values. Cannot be null.
    • newOutputWriter

      protected Writer newOutputWriter() throws IOException
      Throws:
      IOException
    • commit

      public void commit()
      Description copied from interface: Connection
      Commits a current transaction (if any).

      Throwing an error during commit phase cause rollback.

      Specified by:
      commit in interface Connection
      Overrides:
      commit in class AbstractConnection
    • rollback

      public void rollback()
      Description copied from interface: Connection
      Rolls back a current transaction (if any).
      Specified by:
      rollback in interface Connection
      Overrides:
      rollback in class AbstractConnection
    • close

      public void close()
      Description copied from interface: Connection
      Closes the connection and releases all related resources.