Search in sources :

Example 1 with ExternalDataSourceAssembler

use of org.qi4j.library.sql.assembly.ExternalDataSourceAssembler in project qi4j-sdk by Qi4j.

the class ExternalDataSourceTest method assemble.

@Override
public void assemble(ModuleAssembly module) throws AssemblyException {
    BasicDataSource externalDataSource = new BasicDataSource();
    externalDataSource.setDriverClassName("org.apache.derby.jdbc.EmbeddedDriver");
    externalDataSource.setUrl("jdbc:derby:memory:testdbexternal;create=true");
    // START SNIPPET: assembly
    new ExternalDataSourceAssembler(externalDataSource).visibleIn(Visibility.module).identifiedBy("datasource-external-id").withCircuitBreaker(DataSources.newDataSourceCircuitBreaker()).assemble(module);
// END SNIPPET: assembly
}
Also used : ExternalDataSourceAssembler(org.qi4j.library.sql.assembly.ExternalDataSourceAssembler) BasicDataSource(org.apache.commons.dbcp.BasicDataSource)

Aggregations

BasicDataSource (org.apache.commons.dbcp.BasicDataSource)1 ExternalDataSourceAssembler (org.qi4j.library.sql.assembly.ExternalDataSourceAssembler)1