zoukankan      html  css  js  c++  java
  • bean

    <?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:context="http://www.springframework.org/schema/context"
    	xmlns:aop="http://www.springframework.org/schema/aop"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-2.5.xsd
               http://www.springframework.org/schema/aop
               http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
               http://www.springframework.org/schema/tx 
               http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    	<context:component-scan base-package="com.web" />
    	 
    	<bean id="dataSource"	class="org.apache.commons.dbcp.BasicDataSource" 	destroy-method="close">		
    		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
    		<property name="url" value="jdbc:mysql://localhost:3306/ttt" />
    		<!-- 	<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
    				<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl"/> -->
    		<property name="username" value="root" />
    		<property name="password" value="root1234" />
    	</bean>
    
    	<bean id="sessionFactory"	class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    		<property name="dataSource" ref="dataSource" />
    		<property name="annotatedClasses">
    			<list>
    				<value>com.web.model.User</value>
     				<value>com.web.model.Log</value>
    			</list>
    		</property>
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    				<prop key="hibernate.hbm2ddl.auto">update</prop>
    				<prop key="hibernate.show_sql">true</prop>
    			</props>
    		</property>
    	</bean>
    
    	<bean id="txManager"
    		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    		<property name="sessionFactory" ref="sessionFactory" />
    	</bean>
    	
    	<tx:annotation-driven transaction-manager="txManager"/>
    	<!-- 	<aop:aspectj-autoproxy proxy-target-class="true"/>  -->
    </beans>
    
  • 相关阅读:
    临时文档
    栈与堆的区别及其探讨
    经典面试题(一)附答案 算法+数据结构+代码 微软Microsoft、谷歌Google、百度、腾讯
    牛顿迭代法求根
    背包问题---01背包|完全背包(装满背包的方案总数分析及实现)
    背包问题----完全背包(最优方案总数分析及实现)
    背包问题----完全背包(详解|代码实现|背包具体物品的求解)
    60行代码:Javascript 写的俄罗斯方块游戏
    同学们博客链接汇总
    (2015秋) 作业1:学生调研(总分10分)
  • 原文地址:https://www.cnblogs.com/wujixing/p/5764461.html
Copyright © 2011-2022 走看看