![JAR search and dependency download from the Maven repository](/logo.png)
scriptella.driver.spring.package.html Maven / Gradle / Ivy
Spring Framework Integration Driver for Scriptella.
This driver allows working in The Spring Framework environment
and provides an ability to locate Spring-managed data sources.
This driver acts as a proxy and relies on JDBC Bridge.
Important:
The driver requires EtlExecutorBean
to operate, see examples below.
General information
Driver class: scriptella.driver.spring.Driver
URL: Name of the DataSource bean specified in the bean factory/application context
Runtime dependencies: Spring Framework
Driver Specific Properties
Name
Description
Required
ETL Executor Configuration
EtlExecutorBean is intended to be configured from Spring XML configuration files.
See EtlExecutorBean Javadoc for details on
how to configure the executor in Spring.
Example
This example creates a table Spring_Table using a connection from Spring Datasource.
Spring Application Context
Spring application context declares a datasource and an executor. Additional
properties and dependencies like progress indicator may also be injected.
<beans>
<bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>org.hsqldb.jdbcDriver</value></property>
<property name="url"><value>jdbc:hsqldb:mem:spring</value></property>
<property name="username"><value>sa</value></property>
<property name="password"><value></value></property>
</bean>
<bean id="progress" class="scriptella.interactive.ConsoleProgressIndicator"/>
<bean id="executor" class="scriptella.driver.spring.EtlExecutorBean">
<property name="configLocation"><value>etl.xml</value></property>
<property name="progressIndicator"><ref local="progress"/></property>
<property name="properties"><map>
<entry key="tableName"><value>Spring_Table</value></entry>
</map>
</property>
</bean>
</beans>
ETL file etl.xml
<etl>
<connection driver="spring" url="datasource"/>
<script>
CREATE TABLE ${tableName} (
ID INT
)
</script>
</etl>
The usage of executor
is straightforward:
EtlExecutor exec = (EtlExecutor) beanFactory.getBean("executor");
exec.execute();
Additionally you can use java.util.concurrent.Callable
or java.lang.Runnable
invocation interface to avoid unnecessary dependency on Scriptella in application code:
Callable exec = (Callable) beanFactory.getBean("executor");
exec.call();
Batched execution of ETL files
BatchEtlExecutorBean
provides an API
to execute ETL files in a batch.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy