打印本文 打印本文 关闭窗口 关闭窗口
oracle数据库java接口类,
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3577  更新时间:2009/4/22 22:03:57  文章录入:mintao  责任编辑:mintao
     public String strNowtime()

     {

         String dateString="123";

         try

         {

              java.text.SimpleDateFormat formatter=new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

              java.util.Date currentTime_1=new java.util.Date();

              dateString=formatter.format(currentTime_1);

         }

         catch(Exception e)

         {

         }

         return dateString;

     }

 

 

     //--------------------------去掉html---------------------------

     public String HTMLEncode(String Str)

     {

         Str=ebbReplace(Str,"<","&lt;");

         Str=ebbReplace(Str,">","&gt;");

         Str=ebbReplace(Str,"\n","<BR>");

         return Str;

     }

     //--------------------------替换变量---------------------------

     public String ebbReplace(String Str,String oldStr,String newStr)

     {

         String ReturnStr="";

         int i,j,t,m,n;

         n=0;

         j=oldStr.length();

         if (Str.indexOf(oldStr)>-1)

         {

              while(Str.indexOf(oldStr,n)>-1)

              {

                   i=Str.length();

                   if (Str.indexOf(oldStr)==0)

                       Str=newStr+Str.substring(j,i);

                   else

                   {

                       t=Str.indexOf(oldStr);

                       m=(t+j);

                       Str=Str.substring(0,t)+newStr+Str.substring(m,i);

                       n=t+newStr.length()-j+1;

                   }

              }

         }

上一页  [1] [2] [3] [4] [5]  下一页

打印本文 打印本文 关闭窗口 关闭窗口