spring与mybatis整合配置文件

网友投稿 210 2023-03-28


spring与mybatis整合配置文件

最近因为项目要求整合了spring+mybatis架构进行项目开发,现将相关整合配置文件整理如下:

基本架构:spring+springmvc+mybatis

分布式框架:dubbo+zookeeper

数据库:mysql

数据库连接池:Druid

1 数据库连接配置信息jdbc.properties

#mysql version database druid

# setting

validationQuery=SELECT 1

jdbc.driverClassName=com.mysql.jdbc.Driver

jdbc.url=jdbc:mysql://localhost:3306/ivan?useUnicode=true&characterEncoding=utf-8&useSSL=true

jdbc.username=root

jdbc.password=root

2 spring配置文件spring-register.xml

xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns="http://springframework.org/schema/beans"

xsi:schemaLocation="http://springframework.org/schema/beans

http://springframework.org/schema/beans/spring-beans.xsd

http://code.alibabatech.com/schema/dubbo

http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

classpath:config/zookeeper.properties

classpath:config/jdbc.properties

classpath:config/log4j.properties

xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xmlns="http://springframework.org/schema/beans"

xsi:schemaLocation="http://springframework.org/schema/beans

http://springframework.org/schema/beans/spring-beans.xsd

http://code.alibabatech.com/schema/dubbo

http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

classpath:config/zookeeper.properties

classpath:config/jdbc.properties

classpath:config/log4j.properties

3 spring-mybatis.xml

xmlns:tx="http://springframework.org/schema/tx" xmlns="http://springframework.org/schema/beans"

xsi:schemaLocation="http://springframework.org/schema/beans

http://springframework.org/schema/beans/spring-beans-4.1.xsd

http://springframework.org/schema/tx

http://springframework.org/schema/tx/spring-tx-4.1.xsd">

xmlns:tx="http://springframework.org/schema/tx" xmlns="http://springframework.org/schema/beans"

xsi:schemaLocation="http://springframework.org/schema/beans

http://springframework.org/schema/beans/spring-beans-4.1.xsd

http://springframework.org/schema/tx

http://springframework.org/schema/tx/spring-tx-4.1.xsd">

总结

以上所述是给大家介绍的spring与mybatis整合配置文件,希望对大家有所帮助,如果大家有任何疑问请给我留言,会及时回复大家的。在此也非常感谢大家对我们网站的支持!


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:测试管理平台接口设置要求(测试管理平台接口设置要求标准)
下一篇:vue axios同步请求解决方案
相关文章

 发表评论

暂时没有评论,来抢沙发吧~