mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
18 lines
305 B
Groovy
18 lines
305 B
Groovy
package org.test
|
|
|
|
@Grab("hsqldb")
|
|
|
|
@Configuration
|
|
@EnableTransactionManagement
|
|
class Example implements CommandLineRunner {
|
|
|
|
@Autowired
|
|
JdbcTemplate jdbcTemplate
|
|
|
|
@Transactional
|
|
void run(String... args) {
|
|
println "Foo count=" + jdbcTemplate.queryForObject("SELECT COUNT(*) from FOO", Integer)
|
|
}
|
|
}
|
|
|