<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" 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-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd "> <!-- 扫描配置数据源文件 --><context:property-placeholder location="classpath:jdbc.properties"/><!-- 配置数据源 --><bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"><property name="driverClass" value="${jdbc.driverClass}"/><property name="jdbcUrl" value="${jdbc.jdbcUrl}"/><property name="user" value="${jdbc.user}"/><property name="password" value="${jdbc.password}"/></bean><!-- 配置LocalSessionFactoryBean spring 提供整合hibernate工厂bean --><bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"><!-- 注解数据源,进入源码中可以知道sessionFactory有该属性 --><property name="dataSource" ref="dataSource"/><!-- 注入hiberna的核心配置文件属性 --><property name="hibernateProperties"><props><prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialec</prop><prop key="hibernate.hbm2ddl.auto">update</prop><prop key="hibernate.show_sql">true</prop><prop key="hibernate.format_sql">true</prop></props></property><!-- 注入hibernate的映射文件属性 --><property name="mappingLocations"><list><value >classpath:com/itwx/bos/domain/*.xml</value></list></property></bean><!-- 配置事务管理器 --><bean id="transactionManger" class="org.springframework.orm.hibernate5.HibernateTransactionManager"><!-- 注入sessionFactory --><property name="sessionFactory" ref="sessionFactory"></property></bean><!-- 扫描组件 --><context:component-scan base-package="com.itwx.bos"/><!-- 开启事务 --><tx:annotation-driven/><!-- 支持spring注解 --><context:annotation-config/>
</beans>

spring整合中application.xml配置相关推荐

  1. spring整合mybatis的xml配置

    之前在SSM之Mybatis概览_数字公民某杨的博客-CSDN博客有这个示意图: mybatis框架有两类xml配置,一个是全局的xml,另一类是单个接口的xml. 当spring整合mybatis, ...

  2. spring整合mybatis基于xml配置

    数据库 /* Navicat MySQL Data Transfer Source Server         : mysql Source Server Version : 50549 Sourc ...

  3. MongoDB和Java(4):Spring Data整合MongoDB(XML配置)

    最近花了一些时间学习了下MongoDB数据库,感觉还是比较全面系统的,涉及了软件安装.客户端操作.安全认证.副本集和分布式集群搭建,以及使用Spring Data连接MongoDB进行数据操作,收获很 ...

  4. 在eclipse中关于Spring和Hibernate 的XML配置如何提示类的包路径的办法

    转载自  在eclipse中关于Spring和Hibernate 的XML配置如何提示类的包路径的办法 我们在配Spring 或者Hibernate 配置文件的时候,发觉在配置类路径的时候,在双引号下 ...

  5. boot spring 接口接收数据_在 Spring Boot 中使用 Dataway 配置数据查询接口

    Dataway介绍 Dataway 是基于 DataQL 服务聚合能力,为应用提供的一个接口配置工具.使得使用者无需开发任何代码就配置一个满足需求的接口. 整个接口配置.测试.冒烟.发布.一站式都通过 ...

  6. Servlet容器中web.xml配置context-param与init-param

    Servlet容器中web.xml配置<context-param>与<init-param>的区别与作用 <context-param>的作用: web.xml的 ...

  7. Ehcache 中ehcache.xml 配置详解和示例

    EhCache 是一个纯Java的进程内缓存框架,具有快速.精干等特点,是Hibernate中默认的CacheProvider. Ehcache是一种广泛使用的开源Java分布式缓存.主要面向通用缓存 ...

  8. Spring装配Bean---使用xml配置

    声明Bean Spring配置文件的根元素是<beans>. 在<beans>元素内,你可以放所有的Spring配置信息,包括<bean>元素的声明. 除了Bean ...

  9. springboot 读取配置文件_使用 @ConfigurationProperties 在 Spring Boot 中加载配置

    本文地址: 使用 @ConfigurationProperties 在 Spring Boot 中加载配置 使用 Spring Boot 加载配置文件的配置非常便利,我们只需要使用一些注解配置一下就能 ...

最新文章

  1. 【学习笔记】6、标准数据类型—数字类型
  2. kubernetes1.8.4安装指南 -- 5. 证书生成
  3. 文件指针和文件描述符之间的相互转换 fd----fp 和 fp----fd
  4. unity UI事件
  5. php header 404 nginx,ThinkPHP在nginx下怎么设置?路由统统404,疯了~
  6. html css jq 弹幕,Jquery.barrager.js
  7. php echo输出两个变量,php实现关于var_dump和echo输出多变量的测试
  8. C++ 类模板三(类模版中的static关键字)
  9. 虚拟服务器 vmotion,图文并茂:深入了解VMware vMotion过程
  10. Linux终端快捷键的使用
  11. 18104 练习使用多case解题(3种多case的情况)(c语言或c++)
  12. Nginx服务器部署 mycat数据库中间件
  13. Excel VBA操作网页 显示滚动进度条
  14. Strom完整攻略(一)
  15. lzw压缩 java_Java压缩之LZW算法字典压缩与解压讲解
  16. 迷雾之夏服务器维护,迷雾之夏攻略大全 全关卡通关攻略[多图]
  17. 百度网盘解析加速网页版[演示站可用]
  18. LinkedList 类 的简单应用
  19. Confluence迁移中遇到的问题(Data too long for column #39;STRINGVAL#39;)及解决方法
  20. 游戏策划入门教程(2)人物数值设计

热门文章

  1. 360算法技术解密与实践-技术干货满满哒
  2. java session使用_Java互联网架构-高负载集群架构如何解决session一致性问题
  3. 第一章--电商设计表电商项目--数据库设计
  4. 浅谈android中的自定义封装易用的Dialog
  5. SPA (单页应用程序)
  6. centos 安装openoffice (办公软件 WPS)
  7. 《Go 语言程序设计》读书笔记 (七) Goroutine 与系统线程的区别
  8. 如何扩展Laravel Auth来满足项目需求
  9. Hbase 实现微博好友关注功能
  10. Java类型推断将不再支持可变性规范