日期:2014-05-16 浏览次数:20570 次
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <!-- <bean id="dataSource" class="java.sql.DriverManager.BasicDataSource" destroy-method="close">--> <property name="url" value="jdbc:sqlserver://192.168.0.167:1433;DatabaseName=test" /> <property name="username" value="sa" /> <property name="password" value="sa" /> <property name="filters" value="stat" /> <property name="maxActive" value="20" /> <property name="initialSize" value="1" /> <property name="maxWait" value="60000" /> <property name="minIdle" value="1" /> <property name="timeBetweenEvictionRunsMillis" value="60000" /> <property name="minEvictableIdleTimeMillis" value="300000" /> <property name="validationQuery" value="SELECT 'x'" /> <property name="testWhileIdle" value="true" /> <property name="testOnBorrow" value="false" /> <property name="testOnReturn" value="false" /> <property name="poolPreparedStatements" value="true" /> <property name="maxPoolPreparedStatementPerConnectionSize" value="50" /> </bean>
<bean id="dataSource" class="java.sql.DriverManager.BasicDataSource" destroy-method="close"> <!-- <bean id="dataSource" class="com.rh.RHBasicDataSource" destroy-method="close">--> <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/> <property name="url" value="jdbc:jtds:sqlserver://192.168.0.167:1433/test"/> <property name="username" value="sa"/> <property name="password" value="sa"/> <property name="maxActive" value="600"/> <property name="maxWait" value="10000"/> <property name="minIdle" value="500"/> <property name="poolPreparedStatements" value="true"/> <property name="defaultAutoCommit" value="true"/> <property name="validationQuery" value="SELECT 1+1"/> <property name="testOnBorrow" value="true"/> </bean>
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools. --> <hibernate-configuration> <session-factory> <property name="connection.username">sa</property> <property name="connection.url">jdbc:sqlserver://192.168.1.100:1433;databaseName=TestDB</property> <property name="dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="connection.password">sa</property> <property name="hibernate.c3p0.max_size">50</property> <property name="hibernate.c3p0.min_size">5</property> <property name="hibernate.c3p0.timeout">100</property> <property name="hibernate.c3p0.idle_test_period">100</property> <property name="hibernate.c3p0.max_stateme