<bean id="dataSource" class="com.mchange.v2.c3p0.DriverManagerDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver"></property>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/sm"></property>
<property name="user" value="root"></property>
<property name="password" value="1234"></property>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="configLocation" value="classpath:mybatis.cfg.xml"></property>
<property name="typeAliasesPackage" value="com.kayak.sm.model"></property>
<property name="mapperLocations">
<list>
<value>classpath*:/mapper/UserMapper.xml</value>
</list>
</property>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.kayak.sm.mapper"></property>
</bean>
springmvc+mybatis 的配置文件
最新推荐文章于 2021-12-28 22:21:56 发布