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>
相關文章
相關標籤/搜索