mybatis+postgresql WITH RECURSIVE cte as
Cause:java.sql.SQLException:sqlinjectionviolation,syntaxerror:syntaxerror,errorin:'WI...
Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'WITH RECURSIVE cte as (
',expect WITH, actual WITH WITH : WITH RECURSIVE cte as (
select * from pj_task where taskid=? and pjid=? union all
select b.* from pj_task b inner join cte c on b.fatherid=c.taskid and b.pjid=?
)SELECT f.* from cte t, pj_task_det d ,pj_task_file f where d.mstid=t.id and f.mstid=d.id;
; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; sql injection violation, syntax error: syntax error, error in :'WITH RECURSIVE cte as (
',expect WITH, actual WITH WITH : WITH RECURSIVE cte as (
select * from pj_task where taskid=? and pjid=? union all
select b.* from pj_task b inner join cte c on b.fatherid=c.taskid and b.pjid=?
)SELECT f.* from cte t, pj_task_det d ,pj_task_file f where d.mstid=t.id and f.mstid=d.id;; nested exception is java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'WITH RECURSIVE cte as (
',expect WITH, actual WITH WITH : WITH RECURSIVE cte as (
select * from pj_task where taskid=? and pjid=? union all
select b.* from pj_task b inner join cte c on b.fatherid=c.taskid and b.pjid=?
)SELECT f.* from cte t, pj_task_det d ,pj_task_file f where d.mstid=t.id and f.mstid=d.id;
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) 展开
',expect WITH, actual WITH WITH : WITH RECURSIVE cte as (
select * from pj_task where taskid=? and pjid=? union all
select b.* from pj_task b inner join cte c on b.fatherid=c.taskid and b.pjid=?
)SELECT f.* from cte t, pj_task_det d ,pj_task_file f where d.mstid=t.id and f.mstid=d.id;
; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; sql injection violation, syntax error: syntax error, error in :'WITH RECURSIVE cte as (
',expect WITH, actual WITH WITH : WITH RECURSIVE cte as (
select * from pj_task where taskid=? and pjid=? union all
select b.* from pj_task b inner join cte c on b.fatherid=c.taskid and b.pjid=?
)SELECT f.* from cte t, pj_task_det d ,pj_task_file f where d.mstid=t.id and f.mstid=d.id;; nested exception is java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :'WITH RECURSIVE cte as (
',expect WITH, actual WITH WITH : WITH RECURSIVE cte as (
select * from pj_task where taskid=? and pjid=? union all
select b.* from pj_task b inner join cte c on b.fatherid=c.taskid and b.pjid=?
)SELECT f.* from cte t, pj_task_det d ,pj_task_file f where d.mstid=t.id and f.mstid=d.id;
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:84) 展开
1个回答
展开全部
跟MyBatis直接连接数据库
SqlSessionFactory式
MyBatis直接连接候通SqlSessionFactoryBuilder读取MyBatis配置文件
Spring整合MyBatis候通Spring配置文件片段
配置源事务处理式指定由Spring配置文件完
MyBatis配置文件用处比typeAliasSetting等设置要通完
没指定MyBatisSql映射器配置文件我指定MyBatis配置文件MyBatis配置文件指定Sql映射器配置文件
没配置MyBatis配置文件且Sql映射器配置文件与相应接口同名且同路径配置该选项
配置需要sqlSessionFactory进行配置例:
需要注册映射接口
两种式我用扫描:
种式
整合完原使用MyBatis配置文件Sql映射文件都用改变
-
SqlSessionFactory式
MyBatis直接连接候通SqlSessionFactoryBuilder读取MyBatis配置文件
Spring整合MyBatis候通Spring配置文件片段
配置源事务处理式指定由Spring配置文件完
MyBatis配置文件用处比typeAliasSetting等设置要通完
没指定MyBatisSql映射器配置文件我指定MyBatis配置文件MyBatis配置文件指定Sql映射器配置文件
没配置MyBatis配置文件且Sql映射器配置文件与相应接口同名且同路径配置该选项
配置需要sqlSessionFactory进行配置例:
需要注册映射接口
两种式我用扫描:
种式
整合完原使用MyBatis配置文件Sql映射文件都用改变
-
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询