heting

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  40 随笔 :: 9 文章 :: 45 评论 :: 0 Trackbacks

#

     摘要:   1using System;   2using System.Collections.Generic;   3using System.Text;   4using System.Windows.Forms;   5using Syste...  阅读全文
posted @ 2009-09-19 09:46 贺挺 阅读(8434) | 评论 (8)编辑 收藏

     摘要:   1using System;   2   3using System.Text;   4   5using System.Collections;   6   7using System.Collecti...  阅读全文
posted @ 2009-08-06 17:31 贺挺 阅读(642) | 评论 (0)编辑 收藏

<script type="text/javascript">
        
        
//    function treeNodeSelected(arg) {
          //      alert(arg.source.title + ' selected');
            //}
            dojo.addOnLoad(function() {                
                
var s = dojo.widget.byId('parentId').selector;                
                dojo.event.connect(s, 'select', 'treeNodeSelected');
            }
);
        
</script>
        
<div style="float:left;">
            
<s:tree label="${certInfo.cn}.cer" id="parentId" theme="ajax"
                templateCssPath
="/struts/tree.css" showRootGrid="true"
                showGrid
="true">
                
<s:treenode theme="ajax" label="<a href='certificate/admin/queryCert.do?state=3'>吊销的证书</a>" id="child1Id" />                
                
<s:treenode  theme="ajax" label="<a href='certificate/admin/queryCert.do?state=2'>颁发的证书</a>" id="child2Id" />
                
<s:treenode theme="ajax" label="<a href='certificate/admin/queryCert.do?state=1'>挂起的申请</a>" id="child3Id" />
                
<s:treenode theme="ajax" label="<a href='certificate/admin/queryCert.do?state=0'>失败的申请</a>" id="child4Id" />
            
</s:tree>
        
</div>
posted @ 2009-07-10 10:33 贺挺 阅读(367) | 评论 (0)编辑 收藏

--创建job
begin
  sys.dbms_job.submit(job 
=> :job,
                      what 
=> 'begin  
pr_del_log;
end;
',
                      next_date 
=> to_date('03-05-2010 08:00:00''dd-mm-yyyy hh24:mi:ss'),
                      interval 
=> 'trunc(add_months(sysdate,10),''mm'')+7/3');
  
commit;
end;
/


--创建存储过程

CREATE OR REPLACE PROCEDURE PR_DEL_LOG IS
  tables_num  
number(3);
  tables_name 
varchar2(30);
BEGIN
  
select count(*)
    
into tables_num
    
from user_tables
   
where table_name = 'LOG_20090707';
  
if tables_num > 0 then
    tables_name :
= 'LOG' || '_' || to_char(sysdate, 'yyyymm');
  
else
    tables_name :
= 'LOG_20090707';
  
end if;
  
execute immediate 'CREATE table '||tables_name||' as select * from t_sys_log where log_time < add_months(sysdate, -10)';
  
delete from t_sys_log where log_time < add_months(sysdate, -10);
  
commit;
EXCEPTION
  
WHEN OTHERS THEN
    dbms_output.put_line(
'err:' || sqlerrm);
    
rollback;
END;
posted @ 2009-07-07 14:53 贺挺 阅读(855) | 评论 (0)编辑 收藏

 

  • chain   
  •   
  •     用来处理Action链   
  •   
  •     com.opensymphony.xwork2.ActionChainResult   
  •   
  • dispatcher   
  •   
  •     用来转向页面,通常处理JSP   
  •   
  •     org.apache.struts2.dispatcher.ServletDispatcherResult   
  •   
  • freemaker   
  •   
  •     处理FreeMarker模板   
  •   
  •     org.apache.struts2.views.freemarker.FreemarkerResult   
  •   
  • httpheader   
  •   
  •     控制特殊HTTP行为的结果类型   
  •   
  •     org.apache.struts2.dispatcher.HttpHeaderResult   
  •   
  • redirect   
  •   
  •     重定向到一个URL   
  •   
  •     org.apache.struts2.dispatcher.ServletRedirectResult   
  •   
  • redirectAction   
  •   
  •     重定向到一个Action   
  •   
  •     org.apache.struts2.dispatcher.ServletActionRedirectResult   
  •   
  • stream   
  •   
  •     向浏览器发送InputSream对象,通常用来处理文件下载,还可用于返回AJAX数据   
  •   
  •     org.apache.struts2.dispatcher.StreamResult   
  •   
  • velocity   
  •   
  •     处理Velocity模板   
  •   
  •     org.apache.struts2.dispatcher.VelocityResult   
  •   
  • xslt   
  •   
  •     处理XML/XLST模板   
  •   
  •     org.apache.struts2.views.xslt.XSLTResult   
  •   
  • plainText   
  •   
  •     显示原始文件内容,例如文件源代码   
  •   
  •     org.apache.struts2.dispatcher.PlainTextResult   
  •   
  • redirect-action   
  •   
  •     重定向到一个Action   
  •   
  •     org.apache.struts2.dispatcher.ServletActionRedirectResult   
  •   
  • plaintext   
  •   
  •     显示原始文件内容,例如文件源代码   
  •   
  •     org.apache.struts2.dispatcher.PlainTextResult 
  • posted @ 2009-05-18 09:11 贺挺 阅读(1097) | 评论 (0)编辑 收藏

    JAVA四种基本排序,包括冒泡法,插入法,选择法,SHELL排序法.其中选择法是冒泡法的改进,SHELL排序法是插入法的改进.所以从根本上来说可以归纳为两种不同的排序方法:即:插入法&冒泡法

    一插入法:遍历排序集合,每到一个元素时,都要将这个元素与所有它之前的元素遍历比较一遍,让符合排序顺序的元素挨个移动到当前范围内它最应该出现的位置。交换是相邻遍历移动,双重循环控制实现.这种排序法属于地头蛇类型,在我的地牌上我要把所有的东西按一定的顺序规整,过来一个,规整一个.
    处理代码如下:
    public void sort(int[] data) {
    int temp;
    for(int i=1; i〈data.length; i++){
    for(int j=i; (j〉0)&&(data[j]〉data[j-1]); j--){

    temp
    =date[j];
    data[j]
    =data[j-1];
    data[j
    -1]=temp; }

    }

    }

    二冒泡法:比较容易,它的内层循环保证遍历一次后,集合中最小(大)元素出现在它的正确位置,下一次就是次小元素。。。该方法在集合分布的各种情况下交换移动的次数基本不变,属于最慢的一种排序。实现也是双重循环控制。这种排序法属于过江龙,就是要找到极端,但是过奖龙也有大哥,二哥等,所以他们只能是大哥挑了二哥挑.
    处理代码如下:
    public static int [] maopao(int[] data) {
    int temp;
    for(int i=0; i〈data.length-1; i++){
    for(int j=i+1; j〈data.length; j++{
    if(data[i]〈data[j]〉{
    temp
    =data[i];
    data[i]
    =data[j];
    data[j]
    =temp;
    }




    return data;

    三选择法:该方法只是通过遍历集合记录最小(大)元素的位置,一次遍历完后,再进行交换位置操作,类似冒泡,但在比较过程中,不进行交换操作,只记录元素位置。一次遍历只进行一次交换操作。这个对与交换次序比较费时的元素比较适合。这种排序法比冒泡法要城府要深的多,我先记住极端数据,待遍历数据完了之后, 我再处理,不像冒泡法那样只要比自己极端一点的就要处理,选择法只处理本身范围内的最极端数据.
    public static void xuanze(int[] data) {
    int temp;
    for (int i = 0; i 〈 data.length; i++〉 {
    int lowIndex = i;
    for (int j = data.length - 1; j ) i; j--{
    if (data[j] ) data[lowIndex]) {
    lowIndex 
    = j;
    }

    }

    temp
    =data[i];
    data[i]
    =data[lowIndex];
    data[lowIndex]
    =temp;
    }

    }

    四 Shell排序:
    它是对插入排序的一种改进,是考虑将集合元素按照一定的基数划分成组去排序,让每一组在局部范围内先排成基本有序,最后在进行一次所有元素的插入排序。
    public void sort(int[] data) {
    for(int i=data.length/2; i)2; i/=2){
    for(int j=0; j〈i; j++{
    insertSort(data,j,i);
    }


    insertSort(data,
    0,1);


    private void insertSort(int[] data, int start, int inc) {
    int temp;
    for(int i=start+inc; i〈data.length; i+=inc〉{
    for(int j=i; (j)=inc)&&(data[j]〈data[j-inc]〉; j-=inc〉{
    temp
    =data[j];
    data[j]
    =data[j-inc]
    data[j
    -inc]=temp;
    }



    posted @ 2009-04-03 09:51 贺挺 阅读(322) | 评论 (0)编辑 收藏

     

    struts.action.extension
    The URL extension to use to determine if the request is meant for a Struts action
    用URL扩展名来确定是否这个请求是被用作Struts action,其实也就是设置 action的后缀,例如login.do的'do'字。
     
    struts.configuration
    The org.apache.struts2.config.Configuration implementation class
    org.apache.struts2.config.Configuration接口名
     
    struts.configuration.files
    A list of configuration files automatically loaded by Struts 
    struts自动加载的一个配置文件列表
     
    struts.configuration.xml.reload
    Whether to reload the XML configuration or not
    是否加载xml配置(true,false)
     
    struts.continuations.package
    The package containing actions that use Rife continuations
    含有actions的完整连续的package名称
     
    struts.custom.i18n.resources
    Location of additional localization properties files to load
    加载附加的国际化属性文件(不包含.properties后缀)
     
    struts.custom.properties
    Location of additional configuration properties files to load
    加载附加的配置文件的位置

    struts.devMode
    Whether Struts is in development mode or not
    是否为struts开发模式
     
    struts.dispatcher.parametersWorkaround
    Whether to use a Servlet request parameter workaround necessary for some versions of WebLogic
    (某些版本的weblogic专用)是否使用一个servlet请求参数工作区(PARAMETERSWORKAROUND)
     
    struts.enable.DynamicMethodInvocation
    Allows one to disable dynamic method invocation from the URL
    允许动态方法调用
     
    struts.freemarker.manager.classname
    The org.apache.struts2.views.freemarker.FreemarkerManager implementation class
    org.apache.struts2.views.freemarker.FreemarkerManager接口名
     
    struts.i18n.encoding
    The encoding to use for localization messages
    国际化信息内码
     
    struts.i18n.reload
    Whether the localization messages should automatically be reloaded
    是否国际化信息自动加载
     
    struts.locale
    The default locale for the Struts application
    默认的国际化地区信息
     
    struts.mapper.class
    The org.apache.struts2.dispatcher.mapper.ActionMapper implementation class
    org.apache.struts2.dispatcher.mapper.ActionMapper接口
     
    struts.multipart.maxSize
    The maximize size of a multipart request (file upload)
    multipart请求信息的最大尺寸(文件上传用)
     
    struts.multipart.parser
    The org.apache.struts2.dispatcher.multipart.MultiPartRequest parser implementation for a multipart request (file upload)
    专为multipart请求信息使用的org.apache.struts2.dispatcher.multipart.MultiPartRequest解析器接口(文件上传用)

    struts.multipart.saveDir
    The directory to use for storing uploaded files
    设置存储上传文件的目录夹
     
    struts.objectFactory
    The com.opensymphony.xwork2.ObjectFactory implementation class
    com.opensymphony.xwork2.ObjectFactory接口(spring)
     
    struts.objectFactory.spring.autoWire
    Whether Spring should autoWire or not
    是否自动绑定Spring
     
    struts.objectFactory.spring.useClassCache
    Whether Spring should use its class cache or not
    是否spring应该使用自身的cache
     
    struts.objectTypeDeterminer
    The com.opensymphony.xwork2.util.ObjectTypeDeterminer implementation class
    com.opensymphony.xwork2.util.ObjectTypeDeterminer接口
     
    struts.serve.static.browserCache
    If static content served by the Struts filter should set browser caching header properties or not
    是否struts过滤器中提供的静态内容应该被浏览器缓存在头部属性中
     
    struts.serve.static
    Whether the Struts filter should serve static content or not 
    是否struts过滤器应该提供静态内容
     
    struts.tag.altSyntax
    Whether to use the alterative syntax for the tags or not
    是否可以用替代的语法替代tags
     
    struts.ui.templateDir
    The directory containing UI templates
    UI templates的目录夹
     
    struts.ui.theme
    The default UI template theme
    默认的UI template主题
     
    struts.url.http.port
    The HTTP port used by Struts URLs
    设置http端口
     
    struts.url.https.port
    The HTTPS port used by Struts URLs
    设置https端口
     
    struts.url.includeParams
    The default includeParams method to generate Struts URLs
    在url中产生 默认的includeParams

    struts.velocity.configfile
    The Velocity configuration file path
    velocity配置文件路径
     
    struts.velocity.contexts
    List of Velocity context names
    velocity的context列表

    struts.velocity.manager.classname
    org.apache.struts2.views.velocity.VelocityManager implementation class
    org.apache.struts2.views.velocity.VelocityManager接口名
     
    struts.velocity.toolboxlocation
    The location of the Velocity toolbox
    velocity工具盒的位置

    struts.xslt.nocache
    Whether or not XSLT templates should not be cached
    是否XSLT模版应该被缓存
     
    struts.serve.static.browserCache
    该属性设置浏览器是否缓存静态内容。当应用处于开发阶段时,我们希望每次请求都获得服务器的最新响应,则可设置该属性为false。
     
    struts.enable.DynamicMethodInvocation
    该属性设置Struts 2是否支持动态方法调用,该属性的默认值是true。如果需要关闭动态方法调用,则可设置该属性为false。
     
    struts.enable.SlashesInActionNames
    该属性设置Struts 2是否允许在Action名中使用斜线,该属性的默认值是false。如果开发者希望允许在Action名中使用斜线,则可设置该属性为true。
     
    struts.tag.altSyntax
    该属性指定是否允许在Struts 2标签中使用表达式语法,因为通常都需要在标签中使用表达式语法,故此属性应该设置为true,该属性的默认值是true。
     
    struts.devMode
    该属性设置Struts 2应用是否使用开发模式。如果设置该属性为true,则可以在应用出错时显示更多、更友好的出错提示。该属性只接受true和flase两个值,该属性的默认值是false。通常,应用在开发阶段,将该属性设置为true,当进入产品发布阶段后,则该属性设置为false。
     
    struts.i18n.reload
    该属性设置是否每次HTTP请求到达时,系统都重新加载资源文件。该属性默认值是false。在开发阶段将该属性设置为true会更有利于开发,但在产品发布阶段应将该属性设置为false。
    提示开发阶段将该属性设置了true,将可以在每次请求时都重新加载国际化资源文件,从而可以让开发者看到实时开发效果;产品发布阶段应该将该属性设置为false,是为了提供响应性能,每次请求都需要重新加载资源文件会大大降低应用的性能。
     
    struts.ui.theme
    该属性指定视图标签默认的视图主题,该属性的默认值是xhtml。
     
    struts.ui.templateDir
    该属性指定视图主题所需要模板文件的位置,该属性的默认值是template,即默认加载template路径下的模板文件。
     
    struts.ui.templateSuffix
    该属性指定模板文件的后缀,该属性的默认属性值是ftl。该属性还允许使用ftl、vm或jsp,分别对应FreeMarker、Velocity和JSP模板。
     
    struts.configuration.xml.reload
    该属性设置当struts.xml文件改变后,系统是否自动重新加载该文件。该属性的默认值是false。
     
    struts.velocity.configfile
    该属性指定Velocity框架所需的velocity.properties文件的位置。该属性的默认值为velocity.properties。
     
    struts.velocity.contexts
    该属性指定Velocity框架的Context位置,如果该框架有多个Context,则多个Context之间以英文逗号(,)隔开。
     
    struts.velocity.toolboxlocation
    该属性指定Velocity框架的toolbox的位置。
     
    struts.url.http.port
    该属性指定Web应用所在的监听端口。该属性通常没有太大的用户,只是当Struts 2需要生成URL时(例如Url标签),该属性才提供Web应用的默认端口。
     
    struts.url.https.port
    该属性类似于struts.url.http.port属性的作用,区别是该属性指定的是Web应用的加密服务端口。
     
    struts.url.includeParams
    该属性指定Struts 2生成URL时是否包含请求参数。该属性接受none、get和all三个属性值,分别对应于不包含、仅包含GET类型请求参数和包含全部请求参数。

    struts.custom.i18n.resources
    该属性指定Struts 2应用所需要的国际化资源文件,如果有多份国际化资源文件,则多个资源文件的文件名以英文逗号(,)隔开。

    struts.dispatcher.parametersWorkaround
    对于某些Java EE服务器,不支持HttpServlet Request调用getParameterMap()方法,此时可以设置该属性值为true来解决该问题。该属性的默认值是false。对于 WebLogic、Orion和OC4J服务器,通常应该设置该属性为true。
     
    struts.freemarker.manager.classname
    该属性指定Struts 2使用的FreeMarker管理器。该属性的默认值是
    org.apache.struts2.views.freemarker.FreemarkerManager,这是Struts 2内建的FreeMarker管理器。
    struts.freemarker.wrapper.altMap该属性只支持true和false两个属性值,默认值是true。通常无需修改该属性值。
     
    struts.xslt.nocache
    该属性指定XSLT Result是否使用样式表缓存。当应用处于开发阶段时,该属性通常被设置为true;当应用处于产品使用阶段时,该属性通常被设置为false。
     
    struts.configuration.files
    该属性指定Struts 2框架默认加载的配置文件,如果需要指定默认加载多个配置文件,则多个配置文件的文件名之间以英文逗号(,)隔开。该属性的默认值为struts- default.xml,struts-plugin.xml,struts.xml,看到该属性值,读者应该明白为什么Struts 2框架默认加载struts.xml文件了。
    posted @ 2009-04-02 14:34 贺挺 阅读(169) | 评论 (0)编辑 收藏

    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler file://"+resultStr);
    posted @ 2009-04-01 15:02 贺挺 阅读(280) | 评论 (2)编辑 收藏

    create   sequence   name     
    increment   
    by   x   //x为增长间隔     
    start   
    with     x   //x为初始值     
    maxvalue         x   
    //x为最大值       
    minvalue         x   
    //x为最小值     
    cycle                
    //循环使用,到达最大值或者最小值时,从新建立对象     
    cache            x   
    //制定缓存序列值的个数     
                          
    ------------------------一个例子-----------------------
    create   sequence   for_test  --序列名     
    increment   by   1     --每次增加1
    start   with   1     --从1开始
    nomaxvalue     --没有最大值
    nocache        --没有缓存序列

    ----------------------------创建测试表------------------
    create table Test
    (
    TestID 
    int primary key,
    TestName 
    varchar2(20not null,
    Tdescription 
    varchar2(200null
    )

    -----------------------------使用序列-------------------
    insert into Test
    values(for_test.nextval,'序列测试','这是一个序列使用的例子')

    --------------------序列使用结果查询-----------------
    select * from test
    posted @ 2009-03-31 13:57 贺挺 阅读(140) | 评论 (0)编辑 收藏

    drop procedure if exists pro_rep_shadow_rs;   
    delimiter 
    |   
    ----------------------------------   
    --
     rep_shadow_rs   
    --
     用来处理信息的增加,更新和删除   
    --
     每次只更新上次以来没有做过的数据   
    --
     根据不同的标志位   
    --
     需要一个输出的参数,   
    --
     如果返回为0,则调用失败,事务回滚   
    --
     如果返回为1,调用成功,事务提交   
    --
       
    --
     测试方法   
    --
     call pro_rep_shadow_rs(@rtn);   
    --
     select @rtn;   
    --
    --------------------------------   
    create procedure pro_rep_shadow_rs(out rtn int)   
    begin   
        
    -- 声明变量,所有的声明必须在非声明的语句前面   
        declare iLast_rep_sync_id int default -1;   
        
    declare iMax_rep_sync_id int default -1;   
        
    -- 如果出现异常,或自动处理并rollback,但不再通知调用方了   
        -- 如果希望应用获得异常,需要将下面这一句,以及启动事务和提交事务的语句全部去掉   
        declare exit handler for sqlexception rollback;   
        
    -- 查找上一次的   
        select eid into iLast_rep_sync_id from rep_de_proc_log where tbl='rep_shadow_rs';   
        
    -- 如果不存在,则增加一行   
        if iLast_rep_sync_id=-1 then   
          
    insert into rep_de_proc_log(rid,eid,tbl) values(0,0,'rep_shadow_rs');   
          
    set iLast_rep_sync_id = 0;   
        
    end if;   
           
        
    -- 下一个数字   
        set iLast_rep_sync_id=iLast_rep_sync_id+1;   
        
    -- 设置默认的返回值为0:失败   
        set rtn=0;   
           
        
    -- 启动事务   
        start transaction;   
        
    -- 查找最大编号   
        select max(rep_sync_id) into iMax_rep_sync_id from rep_shadow_rs;   
        
    -- 有新数据   
        if iMax_rep_sync_id>=iLast_rep_sync_id then   
            
    -- 调用   
            call pro_rep_shadow_rs_do(iLast_rep_sync_id,iMax_rep_sync_id);   
            
    -- 更新日志   
            update rep_de_proc_log set rid=iLast_rep_sync_id,eid=iMax_rep_sync_id where tbl='rep_shadow_rs';   
        
    end if;   
           
        
    -- 运行没有异常,提交事务   
        commit;   
        
    -- 设置返回值为1  
        set rtn=1;   
    end;   
    |   
    delimiter ;   
    drop procedure if exists pro_rep_shadow_rs_do;   
    delimiter 
    |   
    ---------------------------------   
    --
     处理指定编号范围内的数据   
    --
     需要输入2个参数   
    --
     last_rep_sync_id 是编号的最小值   
    --
     max_rep_sync_id 是编号的最大值   
    --
     无返回值   
    --
    -------------------------------   
    create procedure pro_rep_shadow_rs_do(last_rep_sync_id int, max_rep_sync_id int)   
    begin   
        
    declare iRep_operationtype varchar(1);   
        
    declare iRep_status varchar(1);   
        
    declare iRep_Sync_id int;   
        
    declare iId int;   
        
    -- 这个用于处理游标到达最后一行的情况   
        declare stop int default 0;   
        
    -- 声明游标   
        declare cur cursor for select id,Rep_operationtype,iRep_status,rep_sync_id from rep_shadow_rs where rep_sync_id between last_rep_sync_id and max_rep_sync_id;   
        
    -- 声明游标的异常处理,设置一个终止标记   
        declare CONTINUE HANDLER FOR SQLSTATE '02000' SET stop=1;   
           
        
    -- 打开游标   
        open cur;   
           
        
    -- 读取一行数据到变量   
        fetch cur into iId,iRep_operationtype,iRep_status,iRep_Sync_id;   
        
    -- 这个就是判断是否游标已经到达了最后   
        while stop <> 1 do  
            
    -- 各种判断   
            if iRep_operationtype='I' then   
                
    insert into rs0811 (id,fnbm) select id,fnbm from rep_shadow_rs where rep_sync_id=iRep_sync_id;   
            elseif iRep_operationtype
    ='U' then   
            
    begin   
                
    if iRep_status='A' then   
                    
    insert into rs0811 (id,fnbm) select id,fnbm from rep_shadow_rs where rep_sync_id=iRep_sync_id;   
                elseif iRep_status
    ='B' then   
                    
    delete from rs0811 where id=iId;   
                
    end if;   
            
    end;   
            elseif iRep_operationtype
    ='D' then   
                
    delete from rs0811 where id=iId;   
            
    end if;    
               
            
    -- 读取下一行的数据    
            fetch cur into iId,iRep_operationtype,iRep_status,iRep_Sync_id;   
        
    end while;  -- 循环结束   
        close cur; -- 关闭游标   
     end;   
    posted @ 2009-03-25 09:55 贺挺 阅读(520) | 评论 (0)编辑 收藏

    仅列出标题
    共4页: 上一页 1 2 3 4 下一页