Jfinal连接SQLSERVER相关配置说明

时间:2023-03-08 17:32:29
 driver=net.sourceforge.jtds.jdbc.Driver
jdbcUrl = jdbc:sqlserver://localhost:1433;DatabaseName=test
user =SA
password =123456
devMode = true

上面是连接sqlserver配置文件

在dbconfig里面的代码如下:

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