热门标签 | HotTags
当前位置:  开发笔记 > 数据库 > 正文

org.quartz.JobPersistenceException

运行quartz在MSSQL是出现异常,异常代码如下:org.quartz.JobPersistenceException:Couldntacquirenexttrigger:Couldntretrievetrigger:[Microsoft][SQLServer2000DriverforJDBC]ResultSetcannotre

运行quartz在MS SQL是出现异常,异常代码如下: org . quartz . JobPersistenceException : Couldn 't acquire next trigger: Couldn' t retrieve trigger : [ Microsoft ] [ SQLServer 2000 Driver for JDBC ] ResultSet can not re - read row data for co

运行quartz在MS SQL是出现异常,异常代码如下:

org.quartz.JobPersistenceException: Couldn't acquire next trigger: Couldn't retrieve trigger: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 9. [See nested exception: org.quartz.JobPersistenceException: Couldn't retrieve trigger: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 9. [See nested exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 9.]]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2741)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$35.execute(JobStoreSupport.java:2699)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3711)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2695)
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:266)
Caused by: org.quartz.JobPersistenceException: Couldn'
t retrieve trigger: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 9. [See nested exception: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 9.]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveTrigger(JobStoreSupport.java:1549)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveTrigger(JobStoreSupport.java:1525)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTrigger(JobStoreSupport.java:2728)
... 4 more
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]ResultSet can not re-read row data for column 9.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.validateColumnIndex(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)
at org.apache.commons.dbcp.DelegatingResultSet.getInt(DelegatingResultSet.java:236)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectTrigger(StdJDBCDelegate.java:2129)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveTrigger(JobStoreSupport.java:1531)
... 6 more

分析:使用SQLServer 数据库时,可能发生此异常,原因是微软自己的jdbc驱动不支持同一个记录的字段的重复读取,因为微软加入了text,image这种类型的支持,就限制了字段的回读功能.原因是如果该表存在TEXT, NTEXT, IMAGE等大型字段,对于ResultSet的字段读取必须按照从左向右读,如果你用:

int a = rs.getInt(2);
int b = rs.getInt(1);

则报错。Microsoft给出的方案是不能从右往左也不能连续读2次。

解决方法:这个是微软JDBC驱动的一个bug,我们也可以不用他的驱动,自己到网上下载jtds.jar驱动,使用这种驱动就不会出现上面的异常了.

推荐阅读
author-avatar
多米音乐_34053121
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有