<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆 - 34, 文章 - 1, 評論 - 2, 引用 - 0
    數據加載中……

    hibernate use Websphere datasource

    reference  url:
        http://www.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott.html

    when  webSphere  application server  startup,  hibernate uses  WebSphere datasource.
    step by  step:

         1  coding  statup  constom service

           import javax.management.Notification;
          import javax.management.NotificationFilterSupport;
          import javax.management.NotificationListener;
          import javax.management.ObjectName;
          
          public class WebsphereStartup implements CustomService,NotificationListener {
            public void initialize(Properties arg0) throws Exception {    
               NotificationFilterSupport filter = new NotificationFilterSupport();   
               filter.enableType(NotificationConstants.TYPE_J2EE_STATE_RUNNING);
               ObjectName target = new ObjectName("WebSphere:*,type=Server");   
               AdminServiceFactory.getAdminService().addNotificationListenerExtended(
                target,
                this,
                filter,
                null);
           } 
           public void shutdown() throws Exception {
             // When  was  shutdown,  this  method  is  executed
            
           } 
           public void handleNotification(Notification notification, Object handback) {
             //  write  init  code  here
             init();
           }
          }

         2  modify    hibernate config file  hibernate.cfg.xml

                         <property name="hibernate.connection.datasource">data  source  jndi</property>
                        <property name="hibernate.connection.username">name</property>
                         <property name="hibernate.connection.password">password</property>
                         <property name="hibernate.session_factory_name">HibernateSessionFactory</property>  
                          <property name="connection.autocommit">false</property>
                        <property name="net.sf.hibernate.transaction.JTATransactionFactory">net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property>
                          <property name="show_sql">false</property>
                         <property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>

                  注意:如果是非事務性數據源  那么在hibernate.cfg.xml  必須設置 <property name="connection.autocommit">false</property>
                          為false
                               
         3   create  datasource   jndi  on  was
                 如果是非事務性數據源,在建立數據源時,也要設置為非事務性數據源。
          4    config  custom service  bean  on Websphere
                 was console >servers> application server > server1>manage>custom service >new
           5 start Server

    posted on 2009-12-18 09:19 河馬虎 閱讀(549) 評論(0)  編輯  收藏 所屬分類: WebSphere

    主站蜘蛛池模板: 亚洲第一网站免费视频| 很黄很污的网站免费| 亚洲国产成人精品无码区在线秒播| 亚洲av无码成人精品区在线播放 | 国产成人高清精品免费鸭子 | 亚洲日产无码中文字幕| 永久免费毛片手机版在线看| 国产h肉在线视频免费观看| 国产色爽免费无码视频| 久青草国产免费观看| 337p日本欧洲亚洲大胆人人| 激情综合亚洲色婷婷五月APP| 亚洲综合一区二区精品导航| 亚洲最大激情中文字幕| 亚洲毛片网址在线观看中文字幕| 四虎www免费人成| 毛片视频免费观看| 日本XXX黄区免费看| 久久精品国产免费观看| 人妻无码一区二区三区免费| 99视频在线观看免费| 国产精品偷伦视频免费观看了| 日本激情猛烈在线看免费观看| 亚洲色成人网站WWW永久四虎| 亚洲av永久无码嘿嘿嘿| 亚洲av日韩av无码av| 亚洲国产成人精品激情| 亚洲一区二区三区久久| 亚洲精品国产精品国自产网站| 亚洲天堂男人影院| 亚洲三级高清免费| 亚洲男人的天堂网站| 亚洲一卡2卡三卡4卡无卡下载| 亚洲色无码国产精品网站可下载| 亚洲免费福利在线视频| 亚洲精品女同中文字幕| 亚洲AV日韩AV一区二区三曲| 国产亚洲欧美在线观看| 成人a毛片免费视频观看| 亚洲五月午夜免费在线视频| 十八禁视频在线观看免费无码无遮挡骂过 |