Hibernate配置資料庫方言

2021-06-23 08:45:15 字數 2508 閱讀 9432

在開發hibernate的程式時,需要進行sessionfactory的配置,簡單地說,也就是建立與資料庫之間連線的配置,在hibernate中一般使用xml檔案來進行配置,但是在該檔案的配置中需要設定dialect方言屬性值,對於不同的資料庫,方言的值dialect是不同的,那麼下面就列出在不同的資料庫中如何設定該dialect值(參見下表):   

rdbms

方言db2

org.hibernate.dialect.db2dialect

db2 as/400

org.hibernate.dialect.db2400dialect

db2 os390

org.hibernate.dialect.db2390dialect

postgresql

org.hibernate.dialect.postgresqldialect

mysql

org.hibernate.dialect.mysqldialect

mysql with innodb

org.hibernate.dialect.mysqlinnodbdialect

mysql with myisam

org.hibernate.dialect.mysqlmyisamdialect

oracle (any version)

org.hibernate.dialect.oracledialect

oracle 9i/10g

org.hibernate.dialect.oracle9dialect

sybase

org.hibernate.dialect.sybasedialect

sybase anywhere

org.hibernate.dialect.sybaseanywheredialect

microsoft sql server

org.hibernate.dialect.sqlserverdialect

sap db

org.hibernate.dialect.sapdbdialect

informix

org.hibernate.dialect.informixdialect

hypersonicsql

org.hibernate.dialect.hsqldialect

ingres

org.hibernate.dialect.ingresdialect

progress

org.hibernate.dialect.progressdialect

mckoi sql

org.hibernate.dialect.mckoidialect

interbase

org.hibernate.dialect.interbasedialect

pointbase

org.hibernate.dialect.pointbasedialect

frontbase

org.hibernate.dialect.frontbasedialect

firebird

org.hibernate.dialect.firebirddialect

hibernate配置多個資料庫

我的問題是 我做了乙個平台,這個平台的多個客戶要使用一台伺服器。我用的資料庫是oracle,這樣的話,我想讓hibernate 配置上多個資料庫連線,而這些資料庫是相同表名,只是庫名不同。我查了其他說法 方案一 寫兩個hibernate.cfg.xml 使用資料庫a的時候 configuration...

hibernate資料庫連線

size 12 昨天學習hibernate一天,使用sqlserver2000資料庫,今天早上嘗試了一下mysql資料庫,發現大同小異,不過還是記在這裡吧,好記性不如個爛鍵盤 size color blue 使用mysql資料庫時候的hibernate.cfg.xml檔案內容 color color...

簡單Hibernate資料庫操作

引hibernate中的session,session大多對實體進行操作 publicclassnewdao 資料查詢 查詢所有資料 publiclist selectnew 根據 id查詢該 id的資訊 publicnews selectone string id 資料更新 新增資料 從 acti...