hibernate+spring配置文件
来源:互联网 发布:犀牛软件制作人物 编辑:程序博客网 时间:2024/05/28 16:19
我贴一个我测试时候用的xml文件,你看看你有没有漏什么,
如果你用的callback的方式,就不用配置proxy那一块。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!--数据源datasource的声明-->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:oci8:@pas_new</value>
</property>
<property name="username">
<value>rst</value>
</property>
<property name="password">
<value>rst</value>
</property>
</bean>
<!--Session Factory声明-->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="mappingResources">
<list>
<value>com/rst/hibernate/helloworld/Message.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
net.sf.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">
true
</prop>
</props>
</property>
</bean>
<!-- Spring的数据访问异常转换器(Data Access Exception Translator)定义 -->
<bean id="jdbcExceptionTranslator" class="org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator">
<property name="dataSource"><ref bean="dataSource"/></property>
</bean>
<!-- Hibernate Template定义 -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate.HibernateTemplate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
<property name="jdbcExceptionTranslator"><ref bean="jdbcExceptionTranslator"/></property>
</bean>
<!-- Template和Callback方式实现的DAO-->
<bean id="messageCallbackDAO" class="com.rst.hibernate.testspring.MessageDAOCallbackImpl">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
<property name="hibernateTemplate">
<ref local="hibernateTemplate"/>
</property>
</bean>
</beans>
- hibernate+spring配置文件
- spring+struts+hibernate配置文件
- spring+hibernate事务管理配置文件
- spring+hibernate配置文件
- struts2+hibernate+spring配置文件
- Hibernate+struts+spring配置文件
- Spring结合hibernate配置文件
- Spring结合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- xfire+spring+hibernate 配置文件
- Spring整合hibernate配置文件
- spring hibernate 配置文件模板
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- spring整合hibernate配置文件
- 用yum管理软件
- 2007年第一天开博
- jsp的中文处理解决方法
- windows bat 语法
- Java加密技术与Windows的结合
- hibernate+spring配置文件
- 教育网用户yum使用总结
- Tomcat4.1.24源码分析导引
- Linux时程表
- Decision (Episode 101)
- Truth (Episode 102)
- NFS access forbidden
- Miracle (Episode 103)
- Avatar (Episode 104)