import groovy.sql.Sql
sql = Sql.newInstance(
"jdbc:h2:tcp://localhost/~/test",
"sa",
"",
"org.h2.Driver")
query = """
select
sequence_schema,
sequence_name,
current_value,
increment
from
information_schema.sequences
order by sequence_name
"""
// Sequenceを一覧表示する
sql.eachRow(query){
println("schema:${it.sequence_schema}")
println("name:${it.sequence_name}")
println("current value:${it.current_value}")
println("increment:${it.increment}")
println("-----")
}
動作環境
groovy 1.7.4, JDK6 Update 21, H2 Database 1.2.143 (2010-09-18)
0 件のコメント:
コメントを投稿