MySql的配置:
<!-- 配置多个数据源 默认选择第一个数据源-->
<environments default="development">
<!-- 配置一个数据源 -->
<environment id="development">
<!-- 事物的方式 -->
<transactionManager type="JDBC"/> <!-- 最终会交给spring管理 -->
<!-- 连接池 -->
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1:3306/test?characterEncoding=utf-8"/>
<property name="username" value="root"/>
<property name="password" value="123"/>
</dataSource>
</environment>
</environments>
SqlServer的配置:
<environments default="development">
<environment id="development">
<!-- 事务管理器 -->
<transactionManager type="JDBC" />
<!-- 配置数据源 -->
<dataSource type="POOLED">
<property name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDrvier" />
<property name="url" value="jdbc:sqlserver://127.0.0.1:1434;Database=Users" />
<property name="username" value="root" />
<property name="password" value="root" />
</dataSource>
</environment>
</environments>
Oracle的配置:
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@xx:1521:xx"/>
<property name="username" value="ireport"/>
<property name="password" value="xxxx"/>
</dataSource>
</environment>
</environments>