报错内容
Error querying database. Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 索引 5 超出范围。
### The error may exist in class path resource [com/sunking/main/mapping/ext/riverPatrol/ExtHzzRiverAccountMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: /*SELECT * from HZZ_RIVER_ACCOUNT where PROBLEM_TYPE = ? and dbo.fnGetDistance(?,?,START_LONG,START_LAT)< 0.5*/ SELECT a.* ,b.label from HZZ_RIVER_ACCOUNT a, (select * from ATT_SYS_DICTIONARY where TYPE= ? )b where a.PROBLEM_TYPE=b.value and a.PROBLEM_TYPE=? and dbo.fnGetDistance(?,?,START_LONG,START_LAT)< 0.5
### Cause: com.microsoft.sqlserver.jdbc.SQLServerException: 索引 5 超出范围。
; SQL []; 索引 5 超出范围。; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: 索引 5 超出范围。] with root cause
com.microsoft.sqlserver.jdbc.SQLServerException: 索引 5 超出范围。
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setterGetParam(SQLServerPreparedStatement.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setValue(SQLServerPreparedStatement.java:709)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setString(SQLServerPreparedStatement.java:1034)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
解决
我注释的问题
2,看一下字段和 参数 有没有对应的上,都要仔细看一下,把控制报错SQL拿出 去Navicat 上或者别的视图工具上仔细看一下
版权声明:本文为weixin_44520739原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。