进行测试!环境就是SH框架、当然这只是一个简单的测试!
准备环境就是Spring框架跟Hibernate框架的整合!
然后在Spring配置文件中配置两个数据源、这里我采用的是从c3po数据源配置:
注:配置文件中的url里面要加"&"符号的话得这样写"&"
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.0.xsd">
org.hibernate.dialect.MySQLDialect
true
update
20
PROPAGATION_REQUIRED,readOnly
PROPAGATION_REQUIRED,readOnly
org.hibernate.dialect.MySQLDialect
true
update
20
PROPAGATION_REQUIRED
读的Dao:
public class daoR extends HibernateDaoSupport impleme