2013-09-13 22:25:42 +08:00
|
|
|
package org.test
|
|
|
|
|
2013-10-09 22:16:01 +08:00
|
|
|
@Grab("hsqldb")
|
2013-09-13 22:25:42 +08:00
|
|
|
|
2019-02-08 22:51:38 +08:00
|
|
|
@Configuration(proxyBeanMethods = false)
|
2013-09-13 22:25:42 +08:00
|
|
|
@EnableTransactionManagement
|
|
|
|
class Example implements CommandLineRunner {
|
|
|
|
|
2013-11-05 14:02:20 +08:00
|
|
|
@Autowired
|
|
|
|
JdbcTemplate jdbcTemplate
|
2013-09-13 22:25:42 +08:00
|
|
|
|
2013-11-05 14:02:20 +08:00
|
|
|
@Transactional
|
|
|
|
void run(String... args) {
|
|
|
|
println "Foo count=" + jdbcTemplate.queryForObject("SELECT COUNT(*) from FOO", Integer)
|
|
|
|
}
|
2013-09-13 22:25:42 +08:00
|
|
|
}
|
|
|
|
|