NutzCN Logo
问答 JTDS 连接sqlserver fetch 报错。
发布于 1831天前 作者 nicobeyond 1653 次浏览 复制 上一个帖子 下一个帖子
标签:

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)
3 回复

nutz版本号多少

更换nutz-1.r.66.jar 后视乎不会重新这个问题了,可以正常运行。:smile:

添加回复
请先登陆
回到顶部