zl程序教程

您现在的位置是:首页 >  后端

当前栏目

解决bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

JAVA字符SQL 解决 is 无效 Exception Bad
2023-09-11 14:16:34 时间

解决bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

### Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

 

; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符

 

 

2.出错 原因:

 

1) sql在数据库执行都是OK的。  

 

真正的原因是: 在mybatis 中sql结尾处多了一个" ; " 去掉就可以了。

 

2)  mybatis ,我查出的数据在resultMap中没有对应的映射字段来匹配,查到的结果无法全部填充到对象属性才报错的。

 

即:

  SELECT 

            DISTINCT allData.time AS CREATE_DATE,        

            allData.FORMAT AS FORMAT,         

            allData.ORDER_TYPE  AS ORDER_TYPE,

            allData.ORDER_TYPE_DEC  AS ORDER_TYPE_DEC,

            allData.ACCOUNT  AS ACCOUNT....

 

中FORMAT 对应的   忘了写了