Error querying database. Cause: java.lang.UnsupportedOperationException
程序员文章站
2024-03-13 11:57:45
...
Error querying database. Cause: java.lang.UnsupportedOperationException
错误堆栈信息:
### Error querying database. Cause: java.lang.UnsupportedOperationException
### The error may exist in file [D:\Project\workspace_zxjc\ZXJC\target\classes\mybatis\oracle\MzEqPointMapper.xml]
### The error may involve MzEqPointDao.findThreeDistinctField
### The error occurred while handling results
### SQL: select POINT_NO,POINT_POSITION from MZ_EQ_POINT
### Cause: java.lang.UnsupportedOperationException
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:79)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
at com.sun.proxy.$Proxy60.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
。。。。
出现该异常的原因为:
配置文件中采用了错误了resultType导致类型异常,应该将其改为对应的类型。
如String或者创建对应的javaBean;
这里本人的错误原因是 resultType=“java.util.List” ,应该改成: resultType=“java.lang.String”
这里 resultType 指的是 select 返回的每一行数据 的类型,而不是所有数据组成的类型。
例如:
下一篇: 详解Java如何实现图像灰度化
推荐阅读
-
Error querying database. Cause: java.lang.UnsupportedOperationException
-
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQ
-
Error querying database. Cause: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Cli
-
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: The server time zone value 'Ö
-
org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: The server time zone value 'Ö
-
mybatis 参数格式异常-- Error querying database. Cause: java.lang.NumberFormatException: For input string
-
Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communicat
-
activiti中出现Error querying database.Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException