`
huncent
  • 浏览: 16356 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

grails(groovy)返回mysql存储过程的记录集

阅读更多
create procedure testsp()  
     begin  
        select * from test;  
     end// 


import groovy.sql.Sql;
class TestController {
    def dataSource;
    def index = { 
        Sql sql = new Sql(dataSource);
        sql.eachRow("call testsp()"){
            println it;
        }
        render "ok";
    }
}


如此简单....

分享到:
评论
1 楼 flyli815 2011-01-11  
fgd fgsd

相关推荐

Global site tag (gtag.js) - Google Analytics