pyrebot

Better not to ignore the past but learn from it instead. Otherwise, history has a way of repeating itself.

博客园 首页 新随笔 联系 订阅 管理

 

1 driver=net.sourceforge.jtds.jdbc.Driver
2 jdbcUrl = jdbc:sqlserver://localhost:1433;DatabaseName=test
3 user =SA
4 password =123456
5 devMode = true 

上面是连接sqlserver配置文件

在dbconfig里面的代码如下:

1 // 配置C3p0数据库连接池插件
2         C3p0Plugin c3p0Plugin = new C3p0Plugin(getProperty("jdbcUrl"), getProperty("user"), getProperty("password").trim(),getProperty("driver"));
3         me.add(c3p0Plugin);
4         
5         // 配置ActiveRecord插件
6         ActiveRecordPlugin arp = new ActiveRecordPlugin(c3p0Plugin);
7         me.add(arp);
8         arp.setDialect(new AnsiSqlDialect()); //此处是重点,不然会出错
9         arp.addMapping("blog", Blog.class);

 

posted on 2014-08-28 13:30  pyrebot  阅读(1495)  评论(0编辑  收藏  举报