Error querying database. Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符
### Cause: java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 ; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: ORA-00911: 无效字符 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:965) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) cn.product.interceptor.SessionFilter.doFilter(SessionFilter.java:72)
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 对应的 <result property="format" column="FORMAT" jdbcType="INTEGER" /> 忘了写了。