`
usenrong
  • 浏览: 505966 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
收藏列表
标题 标签 来源
webAppRootKey
在spring的web包里
org.springframework.web.util.WebUtils.setWebAppRootSystemProperty();


需要在web.xml进行声明:

<!--如果不定义webAppRootKey参数,那么webAppRootKey就是缺省的"webapp.root"-->
<context-param>
   <param-name>webAppRootKey</param-name>
   <param-value>ssh.root</param-value>
</context-param>



#在这里设置日志需要存放的位置,这里的变量就是我们在web.xml里设置的
log4j.appender.file.File=${ssh.root}/WEB-INF/logs/subject.log
oracle判断多个表是否存在
 declare
        TYPE table_name_Type IS RECORD ( A varchar2(100) );
        type valtal is table of table_name_Type index by varchar2(100);
        tarr valtal;
        n  number;  
         colc  number; 
        t_name  varchar2(100);  
  begin  
        --在这里添加上要判断的表
        tarr(1).A :='ABC001';
        tarr(2).A :='employee';
        tarr(3).A :='case';
        tarr(4).A :='ABC004';
        tarr(5).A :='ABC005';
        --删除表的部分结束
        
         FOR i IN 1..tarr.count  LOOP
          t_name:=tarr(i).A;
             select   count(*) into n from user_tables where table_name=upper(t_name);  
                if   n>0   then  
                   dbms_output.put_line(t_name);  
                  dbms_output.put_line('表存在!');   
                   -- execute  immediate  'drop  table '||t_name||' cascade constraints';  
                   --判断字段是否存在
                         select count(*) into colc from user_tab_cols where table_name =upper(t_name) and column_name = 'ID';
                         if colc>0 then                            
                                
                              dbms_output.put_line('ID字段存在!');   
                       
                         end if;  
                         if colc=0 then                            
                                
                              dbms_output.put_line('ID字段不存在!');   
                       
                        end if;  
                end   if; 
                  if n=0 then                            
                       dbms_output.put_line(t_name);     
                        dbms_output.put_line('表不存在!');   
                         -- execute  immediate  'create  table '||t_name||' ';  
                  end if;   

         END LOOP;
         tarr.delete;
 end; 
 



oracle判断表是否存在
declare  
 tct number;
begin
select count(*) into tct  from user_tables where table_name='EMPLOYEE'; 
---表存在
   if tct>0 then  
      dbms_output.put_line('表存在!'); 
     -- do something; execute immediate 'drop table EMPLOYEE';       
    end if;
---表不存在
   if tct=0 then  
      
         dbms_output.put_line('表不存在!');  
    end if;
       
end; 
Global site tag (gtag.js) - Google Analytics