错误信息:
org.springframework.jdbc.UncategorizedSQLException:
### Error querying database. Cause: java.sql.SQLException: sql injection violation, syntax error: ERROR. token : LEAVE, pos : 24 : select
leave.*
FROM
MY_LEAVE leave
### The error may exist in file [D:\dev\idea\workspace\attendance\attendance-service\target\classes\mapper\QJiaDAO.xml]
### The error may involve xxx.dao.IQJiaDAO.findAll
### The error occurred while executing a query
### SQL: select leave.* FROM MY_LEAVE leave
### Cause: java.sql.SQLException: sql injection violation, syntax error: ERROR. token : LEAVE, pos : 24 : select
leave.*
FROM
MY_LEAVE leave
; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; sql injection violation, syntax error: ERROR. token : LEAVE, pos : 24 : select
leave.*
FROM
MY_LEAVE leave; nested exception is java.sql.SQLException: sql injection violation, syntax error: ERROR. token : LEAVE, pos : 24 : select
leave.*
FROM
MY_LEAVE leave

 

错误原因:

配置项都正确,但是就是运行不起来,结果是在sql语句编写时,对数据库的表起了一个别名(具体原因可能是关键字导致),将该别名换一个即可。

posted on 2019-07-15 16:06  一抹烛光  阅读(1959)  评论(0编辑  收藏  举报