See: Description
Class | Description |
---|---|
BatchEtlExecutorBean |
Batched implementation to run
ETL executors for Spring IoC container. |
Driver |
Scriptella driver for The Spring Framework
Bean Factory(or Application Context) registered datasources.
|
EtlExecutorBean |
Implementation of
EtlExecutor for Spring IoC container. |
Exception | Description |
---|---|
SpringProviderException |
Thrown to indicate Spring provider failure.
|
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.Driver class: | scriptella.driver.spring.Driver |
URL: | Name of the DataSource bean specified in the bean factory/application context |
Runtime dependencies: | Spring Framework |
Name | Description | Required |
---|
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();
BatchEtlExecutorBean
provides an API
to execute ETL files in a batch.Copyright © Copyright 2006-2019 The Scriptella Project Team.