jtds-1.2.8.jar 连接sqlserver 2014。执行dao.fetch(xx,cnd); 报错。
java.sql.SQLException: “OFFSET”附近有语法错误。
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2894)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2334)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:643)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:506)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:979)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:182)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:224)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:43)
at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:249)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:64)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:204)
at org.nutz.dao.impl.NutDao.fetch(NutDao.java:538)
at com.gzx.Lg2family.initDataByXls(Lg2family.java:82)
at com.gzx.Lg2family.main(Lg2family.java:59)
2019-11-10 16:01:49 DEBUG [main] SQL NextException
java.sql.SQLException: 在 FETCH 语句中选项 NEXT 的用法无效。
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2894)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2334)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:649)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:506)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:979)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.executeQuery(DruidPooledPreparedStatement.java:182)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:224)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:43)
at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:249)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:64)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:204)
at org.nutz.dao.impl.NutDao.fetch(NutDao.java:538)
at com.gzx.Lg2family.initDataByXls(Lg2family.java:82)
at com.gzx.Lg2family.main(Lg2family.java:59)