diversity的专栏

这个人容易懒,不想变成一个咸人,想写点东西

spring jdbc连接池的配置

ORACLE

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"

destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url"
value="jdbc:oracle:thin:@192.168.32.82:1521:rszx1" />
<property name="username" value="system" />
<property name="password" value="byht" />

</bean>


MYSQL

<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://192.168.32.19:3306/wake?useUnicode=true&amp;characterEncoding=UTF-8" />
<property name="url" value="jdbc:mysql://localhost:3306/cxrs_wake?useUnicode=true&amp;characterEncoding=UTF-8" />
<property name="username" value="root" />
<property name="password" value="byht" />
</bean> 


SQLSERVER

 <bean id="dataSource" 
  class="org.springframework.jdbc.datasource.DriverManagerDataSource"> 
  <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> 
  <property name="url" 
  value="jdbc:sqlserver://192.168.32.13:1433;databaseName=dxhbms2" /> 
  <property name="username" value="sa" /> 
  <property name="password" value="123abc!" /> 
  </bean>  


<!-- 目标数据库类型 -->
<bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
<property name="databasePlatform" value="org.eclipse.persistence.platform.database.MySQLPlatform"/> 
<!--<property name="databasePlatform" value="org.eclipse.persistence.platform.database.SQLServerPlatform"/> -->
<!--<property name="databasePlatform" value="org.eclipse.persistence.platform.database.oracle.Oracle11Platform" /> -->
</bean>
<bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect" />

阅读更多
想对作者说点什么? 我来说一句

SPRING JDBC连接池设置

zhujiajia4875 zhujiajia4875

2017-12-08 10:53:24

阅读数:85

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭