首頁 > 資料庫 > mysql教程 > Hibernate主配置文件属性

Hibernate主配置文件属性

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
發布: 2016-06-07 16:03:15
原創
836 人瀏覽過

show_sql其值为TRUE或FALSE 表示是否显示执行的SQL语句 format_sql其值为TRUE或FALSE 表示是否格式化执行的SQL语句 hbm2ddl其值即表示内容如下 create----先删除,在创建相应的数据库表 update----如果表不存在就创建表,不一样就更新,一样就什么都不做 cre

show_sql其值为TRUE或FALSE

表示是否显示执行的SQL语句

format_sql其值为TRUE或FALSE

表示是否格式化执行的SQL语句

hbm2ddl其值即表示内容如下

create----先删除,在创建相应的数据库表

update----如果表不存在就创建表,不一样就更新,一样就什么都不做

create-drop----初始化时创建表,SessionFactory执行close()时删除表。

validate----验证表结构是否一致,如果不一致就抛异常

下面是一些常用数据库连接配置

MySQL

hibernate.dialect org.hibernate.dialect.MySQLDialect
hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql:///test
hibernate.connection.username gavin
hibernate.connection.password


Oracle

hibernate.dialect org.hibernate.dialect.Oracle8iDialect
hibernate.dialect org.hibernate.dialect.Oracle9iDialect
hibernate.dialect org.hibernate.dialect.Oracle10gDialect
hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
hibernate.connection.username ora
hibernate.connection.password ora
hibernate.connection.url jdbc:oracle:thin:@localhost:1521:orcl
hibernate.connection.url jdbc:oracle:thin:@localhost:1522:XE

DB2

hibernate.dialect org.hibernate.dialect.DB2Dialect
hibernate.connection.driver_class com.ibm.db2.jcc.DB2Driver
hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
hibernate.connection.url jdbc:db2://localhost:50000/somename
hibernate.connection.url jdbc:db2:somename
hibernate.connection.username db2
hibernate.connection.password db2

相關標籤:
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
最新問題
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板