亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Hibernate加載其數(shù)據(jù)庫(kù)配置

系統(tǒng) 2155 0
???? Hibernate加載其配置文件hibernate.properties和hibernate.cfg.xml,常用xml文件比較直觀,方便管理, Hibernate 是一個(gè)流行的開源對(duì)象關(guān)系映射工具,方便連接不同數(shù)據(jù)庫(kù),更換數(shù)據(jù)庫(kù),只要修改Hibernate配置文件,大度減少項(xiàng)目的維護(hù)。
???? 完整的配置如下:
<!----> <? 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 >

????????
<!-- ?Database?connection?settings? -->
????????
< property? name ="connection.driver_class" > org.hsqldb.jdbcDriver </ property >
????????
< property? name ="connection.url" > jdbc:hsqldb:hsql://localhost /test</ property >
????????
< property? name ="connection.username" > sa </ property >
????????
< property? name ="connection.password" ></ property >

????????
<!-- ?JDBC?connection?pool?(use?the?built-in)? -->
????????
< property? name ="connection.pool_size" > 1 </ property >

????????
<!-- ?SQL?dialect? -->
????????
< property? name ="dialect" > org.hibernate.dialect.HSQLDialect </ property >

????????
<!-- ?Enable?Hibernate's?automatic?session?context?management? -->
????????
< property? name ="current_session_context_class" > thread </ property >

????????
<!-- ?Disable?the?second-level?cache?? -->
????????
< property? name ="cache.provider_class" > org.hibernate.cache.NoCacheProvider </ property >

????????
<!-- ?Echo?all?executed?SQL?to?stdout? -->
????????
< property? name ="show_sql" > true </ property >

????????
<!-- ?Drop?and?re-create?the?database?schema?on?startup? -->
????????
< property? name ="hbm2ddl.auto" > create </ property >

????????
< mapping? resource ="../*.hbm.xml" />

????
</ session-factory >

</ hibernate-configuration >
???? 常用數(shù)據(jù)庫(kù)連接
???? MySql 3/4/5:
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.MySQLDialect </ property >
??

?? <
property? name ="connection.driver_class" > com.mysql.jdbc.Driver </ property >
??
< property? name ="connection.url" > jdbc:mysql://localhost:3306/test </ property > ????
??
< property? name ="connection.username" > root </ property >
??
< property? name ="connection.password" > </ property >
??? Microsoft SQLServer (via jTDS):
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.SQLServerDialect </ property >
??

?? <
property? name ="connection.driver_class" > net.sourceforge.jtds.jdbc.Driver </ property >
??
< property? name ="connection.url" > jdbc:jtds:sqlserver://localhost:1433/test;useCursors=true </ property > ????
??
< property? name ="connection.username" > sa </ property >
??
< property? name ="connection.password" ></ property > ??
??? IBM DB2:
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.DB2Dialect </ property >
??

?? <
property? name ="connection.driver_class" > com.ibm.db2.jcc.DB2Driver </ property >
??
< property? name ="connection.url" > jdbc:db2://localhost:50000/test </ property > ????
??
< property? name ="connection.username" > db2inst1 </ property >
??
< property? name ="connection.password" ></ property > ?
??? Oracle:
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.OracleDialect </ property >
??

?? <
property? name ="connection.driver_class" > oracle.jdbc.driver.OracleDriver </ property >
??
< property? name ="connection.url" > jdbc:oracle:thin:@localhost:1521:test </ property > ????
??
< property? name ="connection.username" > ora </ property >
??
< property? name ="connection.password" ></ property >
??? Informix:
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.InformixDialect </ property >
??

?? <
property? name ="connection.driver_class" > com.informix.jdbc.IfxDriver </ property >
??
< property? name ="connection.url" > jdbc:informix-sqli://localhost:1526/test:informixserver=server1 </ property > ????
??
< property? name ="connection.username" > root </ property >
??
< property? name ="connection.password" ></ property > ??
??
< property? name ="connection.encoding" > true </ property >
??? Sybase (via jTDS):
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.SybaseDialect </ property >
??
?? < property? name ="connection.driver_class" > net.sourceforge.jtds.jdbc.Driver </ property >
??
< property? name ="connection.url" > jdbc:jtds:sybase://localhost:7100/test;useCursors=true </ property > ????
??
< property? name ="connection.username" > root </ property >
??
< property? name ="connection.password" ></ property >
??? PostgreSQL:
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.PostgreSQLDialect </ property >
??
?? < property? name ="connection.driver_class" > org.postgresql.Driver </ property >
??
< property? name ="connection.url" > jdbc:postgresql://localhost:5432/test </ property > ????
??
< property? name ="connection.username" > root </ property >
??
< property? name ="connection.password" ></ property >
??? MaxDB(SAPDB):
<!----> ?? < property? name ="dialect" > org.hibernate.dialect.SAPDBDialect </ property >
??
?? < property? name ="connection.driver_class" > com.sap.dbtech.jdbc.DriverSapDB </ property >
??
< property? name ="connection.url" > jdbc:sapdb://localhost/test </ property > ????
??
< property? name ="connection.username" > root </ property >
??
< property? name ="connection.password" ></ property >
???


Hibernate加載其數(shù)據(jù)庫(kù)配置


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 99久久国产免费中文无字幕 | 老司机午夜在线视频 | www.xxxx欧美| 免费人成网站在线高清 | 亚洲韩国日本一级二级r级 亚洲韩精品欧美一区二区三区 | 亚洲一区二区三区在线视频 | 精品免费久久久久久成人影院 | 久久精品av77777 | 91久久| 久久er国产精品免费观看1 | 成人欧美一区二区三区视频不卡 | 免费观看国产精品视频 | 日本一级特黄视频 | 亚洲久草 | avtom影院入口四虎 | 久草手机视频在线 | 中文字幕日韩女同互慰视频 | 九九精品免视频国产成人 | 精品国产福利在线 | 亚洲欧美一区二区久久 | 亚洲精品天堂 | 亚洲国产小视频 | 日韩亚洲欧美综合一区二区三区 | 久久都是精品 | 国产成人啪午夜精品网站 | 奇米影视第四色888 奇米影视第四色首页 | 国产精品免费一区二区三区 | 99久久精品费精品国产一区二 | 日本一二三区免费 | 日本高清有码 | 伊人久久波多野结衣中文字幕 | 久久性生活 | 操日韩 | 天天久久综合 | 亚洲国产成人久久笫一页 | 色综合天天 | 男女性高清爱潮视频免费观看 | 久久精品国产99国产精品免费看 | 午夜性色福利视频在线视频 | 99久久精品一区二区三区 | 一区二区日韩 |