SpringMVC配置文件applicationContext.xml操作数据源的配置
来源:互联网 发布:sql语句实例教程 编辑:程序博客网 时间:2024/06/09 18:27
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"><!-- <mvc:annotation-driven /> <context:component-scan base-package="jww.demo.controller*"> </context:component-scan> --><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close"><property name="driverClassName"><value>org.gjt.mm.mysql.Driver</value></property><property name="url"><value>jdbc:mysql://localhost:3306/computer</value></property><property name="username"><value>root</value></property><property name="password"><value>mysqladmin</value></property></bean><bean id="sessionFactory"class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"><property name="dataSource" ref="dataSource"></property><property name="mappingResources"><list> <value>jww/entity/User.hbm.xml</value><value>jww/entity/Computer.hbm.xml</value><value>jww/entity/Commentary.hbm.xml</value><value>jww/entity/BeginTime.hbm.xml</value><value>jww/entity/EndTime.hbm.xml</value></list></property><property name="hibernateProperties"><props><prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop><prop key="hibernate.show_sql">true</prop></props></property></bean><!-- <bean id="personDaoImp" class="jww.demo.dao.imp.PersonDAOImp"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <bean id="personService" class="jww.demo.service.PersonService"> <property name="personDAOImp" ref="personDaoImp"></property> </bean> --><bean id="hibernateUtil" class="jww.entity.HibernateUtil"><property name="sessionFactory" ref="sessionFactory"></property></bean>
<!--具体实现类的注入--><!-- 电脑详情 --><bean id="computerDao" class="jww.dao.ComputerDAO"></bean><bean id="computerService" class="jww.service.ComputerService"><property name="computerDao" ref="computerDao"></property></bean><!-- 用户登录 --><bean id="userDao" class="jww.dao.UserDAO"></bean><bean id="userService" class="jww.service.UserService"><property name="userDao" ref="userDao"></property></bean>
</beans>
0 0
- SpringMVC配置文件applicationContext.xml操作数据源的配置
- applicationContext.xml中数据源的配置
- Spring中applicationContext.xml配置文件中数据库数据源配置
- SpringMVC applicationContext.xml配置
- applicationContext.xml的配置文件
- applicationContext.xml的配置文件
- 在Spring的 applicationContext.xml文件中配置数据源
- Spring 整合 hibernate的 applicationContext.xml 数据源配置
- SpringMVC之ApplicationContext.xml配置文件解析
- hibernate3使用注解,spring配置文件applicationContext.xml的配置
- spring与hibernate集成--spring配置文件applicationContext.xml的配置:
- Spring的配置文件ApplicationContext.xml配置头文件解析
- Spring的配置文件applicationContext.xml
- Spring的配置文件applicationContext.xml
- applicationContext.xml配置文件的读取
- applicationContext.xml 配置文件的认识
- 我的applicationContext.xml配置文件
- applicationContext.xml的基本配置文件
- UIControl 子类的简单使用
- ocra 打包ruby应用
- 我怎么。。
- Android调试
- Android平台利用OpenCL框架实现并行开发初试
- SpringMVC配置文件applicationContext.xml操作数据源的配置
- 【网络协议】TCP分段与IP分片
- Nao机器人相关软件环境配置
- git提交文件代码
- OpenJDK 源代码阅读之 TimSort
- oj(一)r
- 冒泡排序
- IT公司中最流行的10种编程语言
- 使用java反射机制遍历实体类的属性和类型以及值