Package scriptella.spi
package scriptella.spi
Service Provider Interface classes.
Example:
loads
Service Provider Requirements
Although Scriptella supports any JDBC Driver through JDBC Bridge, writing a custom Provider may be easier and more effective. The requirements for Service Provider are minimal:- Provide a class implementing Scriptella Driver Interface. This class must have a public no-arg constructor. We recommend to use AbstractScriptellaDriver as a base.
- Create a subclass of Provider Exception. Override methods if necessary
Driver Registration
No special steps are required to register Scriptella Provider. Simply specify driver class name in a driver attribute of <connection> element. Examples:
<connection driver="provider.class.name" url="provider:url"/>
You may also specify a driver's classpath. Classpath URIs are resolved relative to an ETL file:
<connection driver="provider.class.name" url="provider:url" classpath="driver.jar;lib/driver-addons.jar"/>
In this case the driver is loaded using a separate classloader
Driver Alias
Putting a driver intoscriptella.driver.SHORT_NAME package
and specifying "Driver" as a class name automatically
allows referencing the driver by a SHORT_NAME alias.Example:
<connection driver="SHORT_NAME">
loads
scriptella.driver.SHORT_NAME.Driver class.
Additional Recommendations
urlis not a required attribute for custom providers, nevertheless it may make sense to specify URL protocol for your driver.- If your solution performs scripts compilation and this procedure is expensive, use caching based on Resource indentities as described in javadoc for Connection.
- Pack your provider as a JAR file setting specification title, version and other attributes in manifest. Adding a simple readme file inside a JAR may help users to quickly get how to use it.
- Scriptella built-in drivers can be used as a reference implementation to create a new driver.
-
ClassDescriptionA base class for connections.Helper class to use for executed statements counting.An abstract base for Scriptella drivers.Represents a connection to the system provided by
ScriptellaDriver.Represents connection parameters.Represents vendor dialect information.Global ETL Context available to drivers.Optional interface implemented byConnectionclasses.Callback interface to obtain parameter values.Thrown by connection provider to indicate any kind of failure.Callback interface for query result set iteration.Represents reference to a text resource capable of creating new readers.Service Provider Interface for integrating third-party systems with Scriptella.