日期:2014-05-16 浏览次数:20394 次
ConnectString=jdbc:mysql://192.168.1.110:3306/tplis?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true UserID=root Password=root JdbcDriverName=com.mysql.jdbc.Driver
wuhan.ConnectString=jdbc:mysql://localhost:3306/tplis?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true wuhan.UserID=root wuhan.Password=root wuhan.JdbcDriverName=com.mysql.jdbc.Driver
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>/WEB-INF/classes/net/bolue/resources/dataResources.properties</value> <value>/WEB-INF/classes/net/bolue/resources/wuhanDataResources.properties</value> </list> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>${JdbcDriverName}</value> </property> <property name="url"> <value>${ConnectString}</value> </property> <property name="username"> <value>${UserID}</value> </property> <property name="password"> <value>${Password}</value> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean id="wuhanDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>${wuhan.JdbcDriverName}</value> </property> <property name="url"> <value>${wuhan.ConnectString}</value> </property> <property name="username"> <value>${wuhan.UserID}</value> </property> <property name="password"> <value>${wuhan.Password}</value> </property> </bean> </beans>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"><ref bean="dataSource" /></property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <