Hibernate4学习(一)入门ITeye - 凯发娱乐

Hibernate4学习(一)入门ITeye

2019-01-11 11:28:44 | 作者: 潇晗 | 标签: 装备,文件,中心 | 浏览: 2339

hibernate中心装备文件hibernate.cfg.xml, 笔者将装备文件放在conf.hibernate包下,装备内容如下
 ?xml version=1.0 encoding=utf-8? 
 !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 
 !-- Database connection settings -- 
 property name="connection.driver_class" com.mysql.jdbc.Driver /property 
 property name="connection.url" 
 jdbc:mysql://127.0.0.1:3306/lian?autoReconnect=true amp;useUnicode=true amp;characterEncoding=utf-8 amp;zeroDateTimeBehavior=convertToNull amp;useSSL=false
 /property 
 property name="connection.username" root /property 
 property name="connection.password" root /property 
 !-- JDBC connection pool (use the built-in) -- 
 property name="connection.pool_size" 5 /property 
 !-- property name="javax.persistence.validation.mode" none /property -- 
 !-- SQL dialect -- 
 property name="dialect" org.hibernate.dialect.MySQL5InnoDBDialect /property 
 !-- Enable Hibernates automatic session context management -- 
 property name="current_session_context_class" thread /property 
 !-- Disable the second-level cache -- 
 property name="cache.provider_class" org.hibernate.cache.internal.NoCacheProvider /property 
 !-- Echo all executed SQL to stdout -- 
 property name="show_sql" true /property 
 !-- Drop and re-create the database schema on startup -- 
 property name="hbm2ddl.auto" update /property 
 mapping resource="conf/hibernate/domain/Music.hbm.xml"/ 
 /session-factory 
 /hibernate-configuration 
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表凯发娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章