sql语句在数据库中可以执行,但是测试时无法执行

错误信息:
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语句编写时,对数据库的表起了一个别名(具体原因可能是关键字导致),将该别名换一个即可。

转载于:https://www.cnblogs.com/9402go/p/11189477.html

你可能感兴趣的:(sql语句在数据库中可以执行,但是测试时无法执行)