摘要:
public class MybatisUtils { //获得SqlSession工厂 private static SqlSessionFactory factory; //创建ThreadLocal绑定当前线程中的SqlSession对... 阅读全文
posted @ 2021-12-23 20:13
SentralLiu
阅读(162)
评论(0)
推荐(0)
|
摘要:
public class MybatisUtils { //获得SqlSession工厂 private static SqlSessionFactory factory; //创建ThreadLocal绑定当前线程中的SqlSession对... 阅读全文
posted @ 2021-12-23 20:13
SentralLiu
阅读(162)
评论(0)
推荐(0)
摘要:
相同点:都属于可以获取参数属性 #仅引用,在SQL语句中替代占位符的数值(赋值) ${attribute} 属于字符串拼接SQL,而非预编译占位符,会有注入攻击问题,不建议在常规SQL中使用,常用于可解决动态生降序问题。 但在动态表查询中会使用$... 阅读全文
posted @ 2021-12-23 19:17
SentralLiu
阅读(70)
评论(0)
推荐(0)
摘要:
使用Mybatis搭建web项目,在sqlsession会话关闭后,再使用sqlsession就会出现Executor was closed.异常 Caused by: org.apache.ibatis.executor.ExecutorException:... 阅读全文
posted @ 2021-12-23 17:35
SentralLiu
阅读(527)
评论(0)
推荐(0)
摘要:
那是因为在过滤器没有初始化,因此过滤器一定要复写初始化方法init 在过滤器实现类中,可以没有destroy方法,但必须有init方法 阅读全文
posted @ 2021-12-23 13:58
SentralLiu
阅读(227)
评论(0)
推荐(0)
|