<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<bean id="datasource"
class="com.alibaba.druid.pool.DruidDataSource">
<!--加载驱动-->
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/test?serverTimezone=GMT"></property>
<property name="username" value="root"></property>
<property name="password" value="root"></property>
</bean>
</beans>
Spring框架中配置数据库连接的xml文件代码
最新推荐文章于 2022-05-12 18:47:17 发布