use of org.apache.camel.component.sql.stored.template.TemplateParser in project camel by apache.
the class TemplateCacheTest method shouldCacheTemplateFunctions.
@Test
public void shouldCacheTemplateFunctions() throws InterruptedException {
JdbcTemplate jdbcTemplate = new JdbcTemplate(db);
CallableStatementWrapperFactory fac = new CallableStatementWrapperFactory(jdbcTemplate, new TemplateParser());
BatchCallableStatementCreatorFactory batchFactory1 = fac.getTemplateForBatch("FOO()");
BatchCallableStatementCreatorFactory batchFactory2 = fac.getTemplateForBatch("FOO()");
assertSame(batchFactory1, batchFactory2);
TemplateStoredProcedure templateStoredProcedure1 = fac.getTemplateStoredProcedure("FOO()");
TemplateStoredProcedure templateStoredProcedure2 = fac.getTemplateStoredProcedure("FOO()");
assertSame(templateStoredProcedure1, templateStoredProcedure2);
}
use of org.apache.camel.component.sql.stored.template.TemplateParser in project camel by apache.
the class CallableStatementWrapperTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/storedProcedureTest.sql").build();
jdbcTemplate = new JdbcTemplate(db);
templateParser = new TemplateParser();
this.factory = new CallableStatementWrapperFactory(jdbcTemplate, templateParser);
super.setUp();
}
Aggregations