zoukankan      html  css  js  c++  java
  • hibernate课程 初探单表映射1-7 hibernate配置文件新建

    hibernate  配置文件新建

    1    右键src==>new==》other==>hibernate configuration File==>next==>next==>finish

    2    填写配置文件:dialect    mysql 方言  ;  hbm2ddl.auto ddl生成策略      ;

    文件模板如下:

    配置文件:

    <?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="connection.driver_class">com.mysql.jdbc.Driver</property>
         <property name="connection.url">jdbc:mysql://localhost:3306/bendi</property>
         <property name="connection.username">root</property>
         <property name="connection.password">weidou318</property>
         <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
         
         <property name="show_sql">true</property>
         <property name="format_sql">true</property>
         <property name="hbm2ddl.auto">create</property>
      
      <mapping resource = "Student.hbm.xml"/>     
        </session-factory>
    </hibernate-configuration>

  • 相关阅读:
    控制论学习
    离开
    Python学习
    GHSpro多数据库连接
    django基础 第五章 Django连接数据库
    django基础 第四章 模板标签
    django基础 第三章 模板变量
    django基础 第二章 url配置及文件渲染
    django基础 第一章 环境搭建
    python基础 六、模块和包
  • 原文地址:https://www.cnblogs.com/1446358788-qq/p/8066826.html
Copyright © 2011-2022 走看看