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

hibernate.properties及hibernate.cfg.xml

系統 3095 0

hibernate.properties 和 hibernate.cfg.xml是hibernate的配置文件,對于初學者,可能存在一些配置疑難。本文給出了hibernate.properties及hibernate.cfg.xml內容配置樣例,二者選其一即可

?

hibernate.properties

##---------- this is the connection and hibernate.dialect fo mysql --------------------------------
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=org.gjt.mm.mysql.Driver
hibernate.connection.url=jdbc:mysql://ip:3306/databasename?lastUpdateCount=true;useUnicode=true;characterEncoding=gb2312
hibernate.connection.username=root
hibernate.connection.password=????

##---------- this is the connection and hibernate.dialect fo mssqlserver --------------------------------
#hibernate.dialect=net.sf.hibernate.dialect.SQLServerDialect
#hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
#hibernate.connection.url=jdbc:jtds:sqlserver://IP:1433;DatabaseName=databasename;charset=cp936
#hibernate.connection.username=sa
#hibernate.connection.password=sa

##---------- this is the connection and hibernate.dialect fo ibmdb2 --------------------------------
#hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect
#hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver
#hibernate.connection.url=jdbc:db2:databasename
#hibernate.connection.username=sa
#hibernate.connection.password=sa

##---------- this is the connection and hibernate.dialect fo Oracle --------------------------------
#hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect
#hibernate.dialect=net.sf.hibernate.dialect.OracleDialect
#hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
#hibernate.connection.url=jdbc:oracle:thin:@localhost:1521:databasename
#hibernate.connection.username=ora
#hibernate.connection.password=ora

##---------- after is hibernate config

hibernate.show_sql=true
???????
hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N'
hibernate.jdbc.use_streams_for_binary=true
hibernate.cache.region_prefix=hibernate.test
hibernate.cache.use_query_cache=true
hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider
??
hibernate.connection.pool.size=20
hibernate.jdbc.batch_size=25
hibernate.statement_cache.size = 6
jdbc.fetch_size=50?
jdbc.use_scrollable_resultset=false
jdbc.use_scrollable_resultset=false
hibernate.jdbc.use_streams_for_binary=true
hibernate.max_fetch_depth=1

##############################
### Proxool Connection Pool###
##############################

## Properties for external configuration of Proxool

hibernate.proxool.pool_alias netAuditing

## Only need one of the following

#hibernate.proxool.existing_pool true
#hibernate.proxool.xml cfg/proxool.xml
#hibernate.proxool.properties proxool.properties

##########################
### Second-level Cache ###
##########################

## optimize chache for minimal "puts" instead of minimal "gets" (good for clustered cache)

#hibernate.cache.use_minimal_puts true


## set a prefix for cache region names

hibernate.cache.region_prefix hibernate.test


## enable the query cache

hibernate.cache.use_query_cache true


## choose a cache implementation

hibernate.cache.provider_class net.sf.ehcache.hibernate.Provider

?

hibernate.cfg.xml

<! DOCTYPE?hibernate-configuration
PUBLIC?"-//Hibernate/Hibernate?Configuration?DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"
>

< hibernate-configuration >
< session-factory >
< property? name ="dialect" > net.sf.hibernate.dialect.MySQLDialect </ property >
< property? name ="connection.driver_class" > org.gjt.mm.mysql.Driver </ property >
< property? name ="connection.url" > jdbc:mysql://IP:3306/databasename?lastUpdateCount=true;useUnicode=true;characterEncoding=gb2312 </ property >
< property? name ="connection.driver_class" > org.gjt.mm.mysql.Driver </ property >
< property? name ="connection.username" > root </ property >
< property? name ="connection.password" > root </ property >
< property? name ="show_sql" > false </ property >


<!-- ?Mapping?files? -->
< mapping? resource ="com/orm.hbm.xml" />

</ session-factory >

</ hibernate-configuration >

?

?

?

?

?



hibernate.properties及hibernate.cfg.xml


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

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

【本文對您有幫助就好】

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

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 日韩欧一级毛片在线播无遮挡 | 日韩中文字幕免费 | 天天婷婷 | 2022国产成人综合精品 | 亚洲综合网在线观看首页 | 色八戒国产一区二区三区四区 | 在线欧美视频 | 国产操比 | 久久美剧免费在线观看 | 日本在线不卡免 | 成人久久精品 | 日韩欧美亚洲综合一区二区 | 日本欧美日韩 | 国产婷婷色一区二区三区 | 99精品wwxx在线观看 | 女十八毛片 | 按摩毛片| 欧美激情综合亚洲一二区 | 欧美精品一区二区三区观 | 在线观看人成午夜影片 | 99久久免费看精品国产一区 | 久久视频在线看 | 天天爱天天干天天操 | 国产高清在线a视频大全凹凸 | 欧美成人视 | 精品一区二区三区三区 | xxxxbbbb欧美 | 国产福利视频一区二区微拍 | 久久国产乱子伦免费精品 | 久久婷婷一区二区三区 | 欧美天堂在线视频 | 在线中文字幕亚洲 | 国产一级特黄老妇女大片免费 | 国产精品免费在线播放 | 亚洲在线观看视频 | 久久精品免视看国产陈冠希 | 国产原创精品 | 成人a区| 欧美成人三级一区二区在线观看 | 91精品久久久久久久久久 | 欧美精品在线播放 |