zoukankan      html  css  js  c++  java
  • Hibernate的基本配置

    <?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">
    
    <!-- Generated by MyEclipse Hibernate Tools.                   -->
    <hibernate-configuration>
    
    	<session-factory>
    <!--	指定Hibernate启动的时候自动更新表, 如果不存在则创建-->
    		<property name="hbm2ddl.auto">update</property>
    		
    <!--		声明使用的SQL语句是MySQL的,方言的声明-->
    		<property name="dialect">
    			org.hibernate.dialect.MySQLDialect
    		</property>
    		
    <!--		在控制台打印SQL语句-->
    		<property name="show_sql"> true </property>
    		
    <!--		使用线程,防止遇到异常-->
    		<property name="current_session_context_class"> thread </property>
    		
    <!--		连接信息-->
    		<property name="connection.url">
    			jdbc:mysql://localhost:3306/test
    		</property>
    		<property name="connection.username">root</property>
    		<property name="connection.password">1</property>
    		<property name="connection.driver_class">
    			com.mysql.jdbc.Driver
    		</property>
    		
    <!--	实体类的映射	-->
    		<mapping resource="com/po/User.hbm.xml" />
    
    	</session-factory>
    
    </hibernate-configuration>
    

      

  • 相关阅读:
    meanshift聚类的实现
    birch聚类算法
    DBSCAN聚类算法的实现
    discrete adaboost的C++实现
    kd-tree的实现
    红黑树的实现——插入
    24位位图转8位灰度图
    将RGB数据写入BMP位图文件
    splay树的实现
    AVL树的实现
  • 原文地址:https://www.cnblogs.com/E-star/p/3390539.html
Copyright © 2011-2022 走看看