今天用jdbcTemplate先后执行了两次SQL查询,结果报告错误Can't start a cloned connection while in manual transaction mode.
查了一下资料,才发显示SQLServer的问题,在配置文件中的url连接字符串的后面加上;SelectMethod=cursor即可解决,实例如下:
jdbc:microsoft:sqlserver://192.168.254.128:1433;DatabaseName=IMatic;SelectMethod=cursor
本文介绍了解决在使用jdbcTemplate进行SQL查询时遇到的Can't start a cloned connection while in manual transaction mode错误的方法。通过在连接字符串中添加;SelectMethod=cursor参数解决了SQLServer在手动事务模式下的查询问题。

632

被折叠的 条评论
为什么被折叠?



