blogjava's web log

          blogjava's web log
          ...

          hibernate.hbm.xml

          ?


          <!-- 注意:這是hibernate3
          ??hibernate2?換成
          ??<!DOCTYPE?hibernate-mapping
          PUBLIC?"-//Hibernate/Hibernate?Mapping?DTD?2.0//EN"
          "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">



          hibernate3映射文件配置頭部改成
          <!DOCTYPE?hibernate-mapping?PUBLIC
          ????"-//Hibernate/Hibernate?mapping?DTD?3.0//EN"
          ????"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

          -->
          <? 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 >
          ??
          <!-- jdbc?驅動 -->
          ????
          < property? name ="connection.driver_class" > org.gjt.mm.mysql.Driver </ property >
          ????
          <!-- 連接字符串 -->
          ????
          < property? name ="connection.url" > jdbc:mysql://localhost:3306/wjcms </ property >
          ????
          <!-- 用戶名 -->
          ????
          < property? name ="connection.username" > root </ property >
          ????
          <!-- 數(shù)據(jù)庫密碼 -->
          ????
          < property? name ="connection.password" > wujun </ property >

          ????
          < property? name ="connection.pool_size" > 1 </ property >
          ????
          <!-- dialect?每種數(shù)據(jù)庫都有其相對的dialect?這里是mysql -->
          ????
          < property? name ="dialect" > org.hibernate.dialect.MySQLDialect </ property >
          ????
          <!-- 是否將運行期間的生成的SQL輸出到日志已供調試 -->
          ????
          < property? name ="show_sql" > true </ property >
          ????
          <!-- 是否使用外連接 -->
          ????
          < property? name ="hibernate.use_outer_join" > true </ property >
          ????
          <!-- 事務管理類型,這里是jdbc?的 -->
          ????
          < property? name ="hibernate.transaction.factory_class" >
          ??????org.hibernate.transaction.JDBCTransactionFactory
          ????
          </ property >
          ????
          <!-- 映射文件配置 -->
          ????
          < mapping? resource ="articleVO.hbm.xml" ? />
          ???
          < mapping? resource ="remarkVO.hbm.xml" ? />
          ??
          </ session-factory >
          </ hibernate-configuration >

          如果用的是jndi用
          ?<property name="connection.datasource">java:comp/env/jdbc/wjcms</property>

          詳細介紹查看。

          http://www.huihoo.com/framework/hibernate/reference-v3_zh-cn/session-configuration.html

          posted on 2006-04-15 20:30 record java and net 閱讀(618) 評論(0)  編輯  收藏 所屬分類: 常用配置代碼

          導航

          常用鏈接

          留言簿(44)

          新聞檔案

          2.動態(tài)語言

          3.工具箱

          9.文檔教程

          友情鏈接

          搜索

          最新評論

          主站蜘蛛池模板: 平遥县| 兖州市| 商城县| 札达县| 牡丹江市| 屏东市| 海安县| 万全县| 科技| 延川县| 景德镇市| 阳原县| 衡阳市| 临安市| 互助| 枣强县| 夏邑县| 凤城市| 蒙山县| 永嘉县| 清新县| 申扎县| 翼城县| 沙河市| 罗山县| 南阳市| 永福县| 东安县| 小金县| 泸定县| 沅江市| 中山市| 西华县| 湛江市| 博兴县| 鱼台县| 新巴尔虎右旗| 旬邑县| 新建县| 女性| 株洲县|