jdbc mybatis比较

mybatis的SessionFactory会事先把mapper中的sql导入PreparedStatement,并一直保存。而Jdbc使用时,甚至是JdbcTemplate使用时,都未将PreparedStatement进行缓存,因此在这块性能上Mybatis要好了一些。 spring

<!-- 配置事物数据库 -->
	<bean id="master_sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="master_dataSource" />
		<property name="configLocation" value="classpath:config/mybatis_config_oc.xml" />
		<property name="mapperLocations"
			value="classpath*:com/h/model/*/xml/*.xml" />
	</bean>
相关文章
相关标签/搜索