解决方案 »
- jdbctemplate 批量处理不执行setValues方法
- 文本框设置系统默认的时间
- spring3的事务管理配置问题
- 关于xfire的webservice的客户端
- Tomcat是否支持事务?
- 请大家推荐一下开源的内容管理系统?
- 报Segmentation fault(coredump)错!大侠请指教!!!
- 哪位知道哪里有obe workflow下载的地方
- 求大神帮忙!项目部署在tomcat上没问题,但在jboss6上报错
- 使用Spring提供的OpenSessionInViewFilter如何等待网页完全加载完毕再关闭Session
- 一个死锁的问题
- ssh中有什么可以替换hibernate提高效率的
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd"> <!-- 启用注解风格的配置 -->
<context:annotation-config />
<!-- 配置需要扫描的根包 -->
<context:component-scan base-package="com.jtl.zhcs"/> <!-- 1.dataSource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="jdbc:oracle:thin:@localhost:1521:XE"/>
<property name="username" value="abc"/>
<property name="password" value="abc"/>
</bean>
<!-- 2.sessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<!-- 2.1 dataSource -->
<property name="dataSource" ref="dataSource"/>
<!-- 2.2 方言等属性 -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<!-- 2.3 需要扫描的实体类所在包 -->
<property name="packagesToScan" value="com.jtl.zhcs.entity"/>
</bean>
<bean id="tm" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<tx:annotation-driven transaction-manager="tm"/></beans>
大概知道了我去试试看配jar包