目录
摘要
执行Sql,dataSet,OR mapping
Sql
概述
在 Groovy 中,资源管理的负担由 Groovy 本身负责,所以不用关闭 connection,也不用关闭 ResultSet。
Sql类
建立 Sql 对象
def db = "jdbc:mysql://localhost:3306/groovy?useUnicode=true&characterEncoding=UTF-8"
def username = "root"
def password = "root"
def driver = "com.mysql.jdbc.Driver"
Sql sql = Sql.newInstance(db, username, null, driver)
执行语句
建表
sql.execute("c