摘要: 1 require "rubygems"2 require "mysql"3 def with_db4 dbh=Mysql.real_connect('localhost','root','lovelin','lindb')5 begin6 yield dbh7 ensure8 dbh.close9 end10 end 11 with_db do |db... 阅读全文
posted @ 2009-03-23 22:42 乱草 阅读(1388) 评论(1) 推荐(0)