數據加載中……

          2011年9月6日

          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 陳碧滔 閱讀(118) | 評論 (0)編輯 收藏
          不使用spring讀取ApplicationContet.xml文件中數據庫配置

          在web應用沒有啟用之前我們需要對數據庫進行操作,此事spring沒有加載完成,我們依然可以使用jdbc對數據庫進行操作。
          實現方法如下
          配置一個struts監聽器,
          實現ServletContextListener接口
          public class HuaweiDBListener implements ServletContextListener {

          }
          實現接口中方法
          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對象直接從ApplicationContet.xml中得到數據源配置。

          posted @ 2011-09-06 22:00 陳碧滔 閱讀(289) | 評論 (0)編輯 收藏
          開始寫bolg

          今天開始寫bolg,慢慢記錄自己技術上的成長~~~

          posted @ 2011-09-06 21:53 陳碧滔 閱讀(115) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 田东县| 布拖县| 兴海县| 富裕县| 满洲里市| 康保县| 西峡县| 开阳县| 伊宁市| 安徽省| 石城县| 大荔县| 永仁县| 伊宁县| 琼中| 弥勒县| 措勤县| 灵川县| 平塘县| 闸北区| 库伦旗| 临潭县| 汨罗市| 杭锦后旗| 河北区| 历史| 梁平县| 横峰县| 虹口区| 清镇市| 即墨市| 高碑店市| 耒阳市| 马边| 肥西县| 香格里拉县| 静安区| 仙桃市| 防城港市| 同仁县| 永仁县|