摘要: 在StatementHandler使用prepare()方法后,接下来就是使用ParameterHandler来设置参数,让我们看看它的定义: getParameterObject()是获取参数的,而setParameters()是设置参数的,相当于对一条sql所有的参数都执行ps.setXXX(v 阅读全文
posted @ 2017-09-21 23:02 猪脚踏浪 阅读(980) 评论(0) 推荐(0)
摘要: 我们回忆一下<MyBatis框架的使用及源码分析(十) CacheExecutor,SimpleExecutor,BatchExecutor ,ReuseExecutor> , 这4个Excecutor执行sql操作的最终都调用了StatementHandler 来执行,我们拿SimpleExecu 阅读全文
posted @ 2017-09-21 22:47 猪脚踏浪 阅读(970) 评论(0) 推荐(0)
摘要: Executor分成两大类,一类是CacheExecutor,另一类是普通Executor。 普通类又分为: ExecutorType.SIMPLE: 这个执行器类型不做特殊的事情。它为每个语句的执行创建一个新的预处理语句。ExecutorType.REUSE: 这个执行器类型会复用预处理语句。Ex 阅读全文
posted @ 2017-09-21 00:20 猪脚踏浪 阅读(4931) 评论(0) 推荐(0)