use of org.springframework.jdbc.core.JdbcTemplate in project camel by apache.
the class SqlProducerJSONTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase2.sql").build();
jdbcTemplate = new JdbcTemplate(db);
super.setUp();
}
use of org.springframework.jdbc.core.JdbcTemplate in project camel by apache.
the class SqlConsumerDeleteFailedTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
jdbcTemplate = new JdbcTemplate(db);
super.setUp();
}
use of org.springframework.jdbc.core.JdbcTemplate in project camel by apache.
the class SqlConsumerDeleteTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
jdbcTemplate = new JdbcTemplate(db);
super.setUp();
}
use of org.springframework.jdbc.core.JdbcTemplate in project camel by apache.
the class SqlConsumerDeleteTransformTest method setUp.
@Before
public void setUp() throws Exception {
db = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.DERBY).addScript("sql/createAndPopulateDatabase.sql").build();
jdbcTemplate = new JdbcTemplate(db);
super.setUp();
}
use of org.springframework.jdbc.core.JdbcTemplate in project camel by apache.
the class AnnotatedBookServiceImpl method orderBook.
public void orderBook(String title) throws Exception {
Transactional tx = this.getClass().getAnnotation(Transactional.class);
if (tx == null) {
throw new IllegalStateException("Spring annotation-driven should have instrumented this class as @Transactional");
}
if (!"REQUIRED".equals(tx.propagation().name())) {
throw new IllegalStateException("Should be REQUIRED propagation");
}
if (title.startsWith("Donkey")) {
throw new IllegalArgumentException("We don't have Donkeys, only Camels");
}
// create new local datasource to store in DB
new JdbcTemplate(dataSource).update("insert into books (title) values (?)", title);
template.sendBody(title);
}
Aggregations