Hibernate配置属性
2023-06-13 09:12:00 时间
Hibernate 通过读取默认的配置文件来加载数据库配置信息,该配置文件应放于 classpath 根目录下,默认的配置文件名称为 Hibernate.cfg.xml。Hibernate.cfg.xml 文件中不仅包含数据库的配置信息,而且包含了用户对 Hibernate 所设置的属性信息,如打印 SQL 语句、自动建表等。其配置方法如下:
?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 !--数据库连接的URL-- property name= connection.url jdbc:mysql://localhost:3306/test /property !--数据库连接用户名-- property name= connection.username root /property !--数据库连接密码-- property name= connection.password 111 /property !--Hibernate方言-- property name= dialect org.hibernate.dialect.MySQLDialect /property !--打印SQL语句-- property name= show_sql true /property !--映射文件-- mapping resource= com/lyq/User.hbm.xml / /session-factory /hibernate-configuration
22944.html
Hibernatejavamysql相关文章
- Pandas DataFrame的基本属性详解
- 【说站】python类属性的两种分类
- 关于属性描述符PropertyDescriptor[通俗易懂]
- 写给后端的『js』涂鸦:向对象添加属性
- [翻译] WPF 中用户控件 DataContext/Binding 和依赖属性的问题
- 【Android 属性动画】属性动画 Property Animation 工作原理 ( 线性插值动画 | 非线性插值动画 | 动画计算 | 经过分数 | 插值分数 | 类型估值器)
- 【Groovy】使用 SwingBuilder 构建 Swing 窗口 ( 创建一个 Swing 构造器 | 配置 Swing 窗口的一系列属性 | 设置 Swing 窗口显示 )
- 【Android Gradle 插件】DexOptions 配置 ④ ( additionalParameters 属性配置 | 使用 BuildType 配置多 dex 机制 )
- 【Android Gradle 插件】LintOptions 配置 ⑩ ( textReport 属性配置 | textOutput 属性配置 | warningsAsErrors 属性配置 )
- 【Android Gradle 插件】PackagingOptions 配置 ③ ( merges 属性配置 | excludes 属性配置 )
- springboot-PropertiesFile 自定义配置属性,多环境配置详解编程语言
- Hibernate setProperty方法:为Configuation对象指定配置属性
- Hibernate hibernate.default_schema属性:指定默认的表空间
- Linux进程:探索它们的属性与特性(linux进程的属性)
- Oracle中变量的属性及其使用方法(oracle中变量的属性)
- JavaScriptprototype属性使用说明
- 用正则查找html中有id属性的html标签
- JavaScript运行时库属性一览表