sql server 配置,查询不好用

jfinalConfig的配置语句

blob.png

jar包

blob.png

使用代码

blob.png



程序可以正常启动,但是查询就报错,请问原因出在那里啊?

com.jfinal.plugin.activerecord.ActiveRecordException: com.microsoft.sqlserver.jdbc.SQLServerException: Object名 'tb_jan_move'无效。

at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:323)

at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:334)

at cn.tre.services.DBService.insertDataToP(DBService.java:33)

at cn.tre.api.DBDataAPI.insertDataToP(DBDataAPI.java:24)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:55)

at com.jfinal.plugin.activerecord.tx.Tx.intercept(Tx.java:76)

at com.jfinal.core.ActionInvocation.invoke(ActionInvocation.java:51)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:73)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:72)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Object名 'tb_jan_move'无效。

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:156)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1373)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:371)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:322)

at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4003)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1550)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:160)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:133)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:265)

at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:227)

at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:308)

at com.jfinal.plugin.activerecord.DbPro.find(DbPro.java:321)

... 28 more




评论区

似水流言1

2016-12-01 13:24

方言设置不对还有要设置DriverClass

JFinal

2016-12-01 13:29

方言设置:arp.setDiaect(SqlServerDialect())
如果用了生成器,也要设置:generator.setDialect(new SqlServerDialect())

静静滴疯

2016-12-01 13:45

@JFinal 是因为我缺少jar包吗?我引入不了SqlServerDialect()

静静滴疯

2016-12-01 14:24

@JFinal 换了jfinal 2.2的jar包好用了

静静滴疯

2016-12-01 14:27

@JFinal 可还是报相同的错误

静静滴疯

2016-12-01 14:28

@似水流言1 DriverClass怎么设置?

似水流言1

2016-12-01 16:05

arp.setDriverClass("com.microsoft.sqlserver.jdbc.SQLServerDriver");

静静滴疯

2016-12-02 10:27

热门反馈

扫码入社