數(shù)據(jù)加載中……

          2011年9月7日

          trigger

          create or replace trigger pm4h_hw_db.t_get_sys_bhstore
            after insert on pm4h_ad.sys_bhstore
          declare
            pragma autonomous_transaction;
            tablename varchar2(64);
            cursor cr is
              select bhtable from pm4h_ad.sys_bhstore where bhmodelid = 'TODBH';
          begin
            open cr;
            fetch cr
              into tablename;
            while cr%found loop
              if fun_is_exists_table(tablename) = 0 then
                pm4h_hw_db.create_bh_table(tablename);
              end if;
              fetch cr
                into tablename;
            end loop;
            close cr;
          end pm4h_hw_db.t_get_sys_bhstore;

          posted @ 2011-09-07 16:45 陳碧滔 閱讀(120) | 評(píng)論 (0)編輯 收藏

          2011年9月6日

          不使用spring讀取ApplicationContet.xml文件中數(shù)據(jù)庫(kù)配置

          在web應(yīng)用沒(méi)有啟用之前我們需要對(duì)數(shù)據(jù)庫(kù)進(jìn)行操作,此事spring沒(méi)有加載完成,我們依然可以使用jdbc對(duì)數(shù)據(jù)庫(kù)進(jìn)行操作。
          實(shí)現(xiàn)方法如下
          配置一個(gè)struts監(jiān)聽(tīng)器,
          實(shí)現(xiàn)ServletContextListener接口
          public class HuaweiDBListener implements ServletContextListener {

          }
          實(shí)現(xiàn)接口中方法
          public void contextInitialized(ServletContextEvent context) {
              String serverPath = context.getServletContext().getRealPath("/"); 
              ApplicationContext appC= new FileSystemXmlApplicationContext(serverPath + "WEB-INF\\spring\\applicationContext.xml"); 
              ComboPooledDataSource c = (ComboPooledDataSource) appC.getBean("dataSource"); 
              System.out.println("DriverClass=="+ c.getDriverClass());
          }


          使用ComboPooledDataSource對(duì)象直接從ApplicationContet.xml中得到數(shù)據(jù)源配置。

          posted @ 2011-09-06 22:00 陳碧滔 閱讀(291) | 評(píng)論 (0)編輯 收藏
          開(kāi)始寫(xiě)bolg

          今天開(kāi)始寫(xiě)bolg,慢慢記錄自己技術(shù)上的成長(zhǎng)~~~

          posted @ 2011-09-06 21:53 陳碧滔 閱讀(115) | 評(píng)論 (0)編輯 收藏
          僅列出標(biāo)題  
          主站蜘蛛池模板: 伊宁县| 镇巴县| 广饶县| 赫章县| 武威市| 佳木斯市| 德钦县| 满洲里市| 北碚区| 正宁县| 门头沟区| 临湘市| 页游| 宜兴市| 柘荣县| 本溪市| 工布江达县| 佳木斯市| 清河县| 柞水县| 昌都县| 湘潭县| 额尔古纳市| 秀山| 和平县| 静海县| 惠东县| 康保县| 南阳市| 古交市| 无棣县| 甘肃省| 彩票| 舒城县| 南丹县| 永平县| 基隆市| 昆山市| 宜兴市| 静乐县| 阿图什市|