A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 血染江山 初级黑马   /  2019-6-21 14:11  /  707 人查看  /  0 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd
       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
">
    <!--配置应用名称,便于注册中心计算机计算依赖-->
    <dubbo:application name="dubbodemo_provider"/>
    <!--p配置连接注册中心 提供生产-->
    <dubbo:registry address="zookeeper://192.168.200.129:2181"/>
    <!--生产端的端口 以及dubbo协议-->
    <dubbo:protocol name="dubbo" port="20880"/>
    <!--扫描注解@Service 为类往注册中心发布服务-->
    <dubbo:annotation package="com.itheima.service.impl"/>
   
    <!--配置数据源-->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="username" value="root" />
        <property name="password" value="root" />
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url" value="jdbc:mysql://localhost:3306/test" />
    </bean>
   
    <!--配置平台事务管理器-->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <!--需要数据源-->
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <!--开启事务控制的注解支持-->
    <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>

</beans>

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马