zoukankan      html  css  js  c++  java
  • 以Java属性文件的格式创建Hibernate的配置文件和DTD特殊符号作用

    演示样例代码

    hibernate.dialect=org.hibernate.dialect.MySQLDialect
    hibernate.connection.driver_class=com.mysql.jdbc.Driver
    hibernate.connection.url=jdbc:mysql://localhost:3306/SAMPLEDB
    hibernate.connection.username=root
    hibernate.connection.password=1234
    hibernate.connection.show_sql=true

    属性

    hibernate.dialect  指定数据库使用的sql方言   

    hibernate.connection.driver_class指定数据库的驱动程序

    hibernate.connection.url指定连接数据的URL

    hibernate.connection.username指定连接数据库的用户名

    hibernate.connection.password  指定连接数据库的口令

    hibernate.connection.show_sql  假设为true,表示程序执行时。会在控制台输出sql语句,这有利于跟踪Hibernate的运  行状态。默觉得false。

    在应用开发測试阶段。能够把这个属性设为true,以便跟踪和调试应用程序,在应用公布阶段,应该把这个属性设为false,一边降低应用的输出信息。提高执行性能


    DTD特殊符号作用

    无符号  该子元素在父元素内必须存在且仅仅能存在一次

    +           该子元素在父元素内必须存在。能够存在一次或者多次

    *            该子元素在父元素内能够不存在,或者存在一次或者多次,它是比較经常使用的符号

    ?          该子元素在父元素内能够不存在,或者仅仅存在一次,它是比較经常使用的符号



  • 相关阅读:
    改进RazorPad
    ViewBag、ViewData和TempData的使用和区别
    MVC3路由设置访问后缀 html jsp
    RazorPad中的ModelProvider
    使用NUnit进行项目的单元测试
    有关WCF的契约问题
    常用的Windows批处理
    SmartBusinessDevFramework架构设计-2:结构图示
    SQL中查询语句的使用
    林子祥
  • 原文地址:https://www.cnblogs.com/claireyuancy/p/6824632.html
Copyright © 2011-2022 走看看