【Hibernate学习笔记-4】在hibernate.cfg.xml中配置C3P0数据源


<?xml version="1.0" encoding="GBK"?><!DOCTYPE hibernate-configuration PUBLIC"-//Hibernate/Hibernate Configuration DTD 3.0//EN""http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"><hibernate-configuration><session-factory><property name="connection.driver_class">com.mysql.jdbc.Driver</property><property name="connection.url">jdbc:mysql://localhost:3306/sampledb</property><property name="connection.username">root</property><property name="connection.password">qaz</property><property name="hibernate.c3p0.max_size">20</property><property name="hibernate.c3p0.min_size">1</property><property name="hibernate.c3p0.timeout">5000</property><property name="hibernate.c3p0.max_statements">100</property><property name="hibernate.c3p0.idle_test_period">3000</property><property name="hibernate.c3p0.acquire_increment">2</property><property name="hibernate.c3p0.validate">true</property><property name="dialect">org.hibernate.dialect.MySQLDialect</property><property name="hbm2ddl.auto">update</property><!--①--><property name="show_sql">true</property><property name="hibernate.format_sql">true</property><mapping class="org.crazyit.app.domain.News"/></session-factory></hibernate-configuration>
【Hibernate学习笔记-4】在hibernate.cfg.xml中配置C3P0数据源的更多相关文章
- Hibernate学习笔记二:Hibernate缓存策略详解
一:为什么使用Hibernate缓存: Hibernate是一个持久层框架,经常访问物理数据库. 为了降低应用程序访问物理数据库的频次,从而提高应用程序的性能. 缓存内的数据是对物理数据源的复制,应用 ...
- Hibernate学习笔记--第一个Hibernate框架程序
一般使用集成开发环境是,把所需的类库添加到项目属性的库路径中,开发工具在部署时会自动复制所需要的类包到WEB-INF\lib目录下 MyEclipse中: 创建项目,右击项目->myeclips ...
- hibernate学习笔记(5)在数据库中存取图片
如何从数据库读取存入的图片,即Blob(二进制)数据. 先从数据库读取对象. 再从获取的对象中得到blob对象. 通过blob对象的getBinaryStream()方法获取input输出流. 之后通 ...
- spring mvc学习笔记(一)web.xml文件配置的一点重要信息
通过这个web.xml文件可以看出,所有的*.shtml的请求,都会被springmvc这个servlet处理.这里如果没有指定contextConfigLocation这个参数,将会按照默认规则在c ...
- [原创]java WEB学习笔记80:Hibernate学习之路--- hibernate配置文件:JDBC 连接属性,C3P0 数据库连接池属性等
本博客的目的:①总结自己的学习过程,相当于学习笔记 ②将自己的经验分享给大家,相互学习,互相交流,不可商用 内容难免出现问题,欢迎指正,交流,探讨,可以留言,也可以通过以下方式联系. 本人互联网技术爱 ...
- Hibernate学习笔记之EHCache的配置
Hibernate默认二级缓存是不启动的,启动二级缓存(以EHCache为例)需要以下步骤: 1.添加相关的包: Ehcache.jar和commons-logging.jar,如果hibernate ...
- hibernate 学习笔记2
1.Criteria查询接口适用于组合多个限制条件来搜索一个查询集. 要使用Criteria,需要遵循以下步骤: *创建查询接口: Criteria criteria=session.createCr ...
- Hibernate学习笔记(一)
2016/4/18 19:58:58 Hibernate学习笔记(一) 1.Hibernate框架的概述: 就是一个持久层的ORM框架. ORM:对象关系映射.将Java中实体对象与关系型数据库中表建 ...
- Hibernate 学习笔记一
Hibernate 学习笔记一 今天学习了hibernate的一点入门知识,主要是配置domain对象和表的关系映射,hibernate的一些常用的配置,以及对应的一个向数据库插入数据的小例子.期间碰 ...
随机推荐
- POJ 2516 Minimum Cost 最小费用流 难度:1
Minimum Cost Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 13511 Accepted: 4628 Des ...
- 在mvc中弹出提示框
在传统的WebForm中,我们要弹出一个alert提示框非常简单,只要在页面中输出alert即可,比如输出: Response.Write("<script >alrer('我是 ...
- bzoj1464
题解: 简单bfs 显然不能到负数 也不能超过k两倍 代码: #include<bits/stdc++.h> using namespace std; ; int b[N],vis[N], ...
- wavepicking
http://www.seismology.harvard.edu/research/wavePicking.html
- C#中datagridview选中行后textbox显示选中的内容
我想让datagridview中某一行被选中时,textbox中显示选中的值,datagridview的选中模式是整行:this.dataGridView1.SelectionMode = DataG ...
- 使用idea创建springboot项目并打成war包发布到weblogic上
部署tomcat也是类似的,但是需要注意项目配置的路径,或者直接将项目放到webapp的ROOT目录下. 使用工具:intelliJ IDEA2016.3, jdk1.8 ,weblogic12 一 ...
- IOS 获取中英文字符串长度
//得到中英文混合字符串长度 方法1 - (int)convertToInt:(NSString*)strtemp { int strlength = 0; char* p = (char*)[str ...
- MyEclipse2014配置Tomcat开发JavaWeb程序JSP以及Servlet
http://blog.csdn.net/21aspnet/article/details/21867241 1.安装准备 1).下载安装MyEclipse2014,这已经是最新版本. 2).下载 ...
- Stones 优先队列
Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk ...
- 【codeforces div3】【E. Cyclic Components】
E. Cyclic Components time limit per test 2 seconds memory limit per test 256 megabytes input standar ...