public class DbTest {
public static void main(String[] args) {
Prop prop = PropKit.use("jdbc.properties");
DruidPlugin dp = new DruidPlugin(prop.get("jdbc.url"), prop.get("jdbc.username"), prop.get("jdbc.password"),
prop.get("jdbc.driver"));
ActiveRecordPlugin arp = new ActiveRecordPlugin(dp);
arp.addMapping("base_article", Article.class);
dp.start();
arp.start();
System.out.println(JSON.toJSONString(Article.dao.findById(1)));
}
}运行如上代码,总是提示
Can not create Table object, maybe the table base_article is not exists.
Exception in thread "main" com.jfinal.plugin.activerecord.ActiveRecordException: com.microsoft.sqlserver.jdbc.SQLServerException: '`' 附近有语法错误。
但是数据库base_article 是存在的,使用beetlsql、hibernate测试都没问题,唯独使用ActiveRecord提示这个错误
使用的是 jFinal2.2
数据库使用的是SqlServer2008
项目:JFinal