hibernate的配置文件,使用XML方式

原文链接: http://www.cnblogs.com/wangjianly/p/8482695.html
xml version="1.0" encoding="UTF-8"?>

 
DOCTYPE hibernate-configuration PUBLIC 
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"  
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">


<hibernate-configuration>
    

    <session-factory>

        

        <property name="hibernate.connection.driver_class">
            com.mysql.jdbc.Driver
        property>

        

        <property name="hibernate.connection.url">
            jdbc:mysql://localhost/hibernate
        property>

        

        <property name="hibernate.connection.username">rootproperty>

        

        <property name="hibernate.connection.password">123456property>

        

        <property name="hibernate.connection.pool.size">20property>

        

        <property name="hibernate.show_sql">trueproperty>

        

        <property name="jdbc.fetch_size">50property>

        

        <property name="jdbc.batch_size">23property>

        

        <property name="jdbc.use_scrollable_resultset">falseproperty>

        

        <property name="Connection.useUnicode">trueproperty>

        

        <property name="connection.characterEncoding">gbkproperty>

        

        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialectproperty>

        
        

        <property name="current_session_context_class">threadproperty>

        
        <property name="hibernate.connection.autocommit">trueproperty>

        
        <mapping resource="com/itheima/a_hello/User.hbm.xml" />
    session-factory>
hibernate-configuration>  
View Code

 

转载于:https://www.cnblogs.com/wangjianly/p/8482695.html

你可能感兴趣的:(hibernate的配置文件,使用XML方式)