
scriptella.spi.package.html Maven / Gradle / Ivy
The newest version!
Service Provider Interface classes.
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 into scriptella.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
url
is 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.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy