??xml version="1.0" encoding="utf-8" standalone="yes"?>国产一区国产二区国产三区,深夜福利一区,日本精品久久久久影院http://www.aygfsteel.com/jesson2005/category/19859.htmlN文hQ乃市井一俗h也,ȝ卷书Q跨江河千里Q故甛_一游; 一两滴辛酸Q三四年学业Q五六点_墨Q七八笔买卖Q九(ji)十道人情?/description>zh-cnTue, 13 Nov 2007 22:07:49 GMTTue, 13 Nov 2007 22:07:49 GMT60截取字符?针对字符串插入数据库,长度问题)http://www.aygfsteel.com/jesson2005/articles/159056.html张金?/dc:creator>张金?/author>Thu, 08 Nov 2007 03:42:00 GMThttp://www.aygfsteel.com/jesson2005/articles/159056.htmlhttp://www.aygfsteel.com/jesson2005/comments/159056.htmlhttp://www.aygfsteel.com/jesson2005/articles/159056.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/159056.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/159056.html   * 截取字节数组长度不超qlen的字W串,oracle数据库中varchar2(4000)长度相当于java中byte?000个长?br />   * */
     public String cutString(String str,int len){
      byte[] a=str.getBytes();
    byte[] b=new byte[len];
    if(a.length>len){
    System.arraycopy(a, 0, b, 0, len);
    }
    return new String(b);
     }

]]>
常用工具c?/title><link>http://www.aygfsteel.com/jesson2005/articles/153319.html</link><dc:creator>张金?/dc:creator><author>张金?/author><pubDate>Tue, 16 Oct 2007 08:55:00 GMT</pubDate><guid>http://www.aygfsteel.com/jesson2005/articles/153319.html</guid><wfw:comment>http://www.aygfsteel.com/jesson2005/comments/153319.html</wfw:comment><comments>http://www.aygfsteel.com/jesson2005/articles/153319.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jesson2005/comments/commentRss/153319.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jesson2005/services/trackbacks/153319.html</trackback:ping><description><![CDATA[<p><br /> /**<br />    import com.lowagie.text.*;<br />    import com.lowagie.text.pdf.PdfWriter;<br />    import java.io.*;<br />    import java.text.*;<br />    文档输出<br /> */<br /> public static void billImagePdfGenerator(String pdfMsg, String brand, OutputStream output)<br />     {<br />         Document document = new Document(PageSize.A4);<br />         String tempStr = "";<br />         try<br />         {<br />             PdfWriter.getInstance(document, output);<br />             document.open();<br />             Image jpg = Image.getInstance("emice/jsp/images/bi" + brand + ".jpg");<br />             jpg.scalePercent(80F);<br />             document.add(jpg);<br />             BufferedReader reader = null;<br />             reader = new BufferedReader(new StringReader(pdfMsg));<br />             while((tempStr = reader.readLine()) != null) <br />             {<br />                 if(tempStr.startsWith("Page  "))<br />                     document.newPage();<br />                 Phrase phrase = new Phrase(10F, tempStr + "\n", FontFactory.getFont("Courier", 9F));<br />                 document.add(phrase);<br />             }<br />             document.close();<br />             reader.close();<br />         }<br />         catch(DocumentException de)<br />         {<br />             System.err.println(de.getMessage());<br />         }<br />         catch(IOException ioe)<br />         {<br />             System.err.println(ioe.getMessage());<br />         }<br />     }<br />     <br />     <br />     <br />   /**<br />      获取向前或者向后几天的日期<br />   */ <br />   public static final String getCaseFormatTime(int shiftDay)<br />     {<br />         Calendar cal = Calendar.getInstance();<br />         int year = cal.get(1);<br />         int month = cal.get(2);<br />         int date = cal.get(5);<br />         int hour = cal.get(11);<br />         int minute = cal.get(12);<br />         int second = cal.get(13);<br />         date += shiftDay;<br />         cal.set(year, month, date, hour, minute, second);<br />         Date d = cal.getTime();<br />         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);<br />         String dateString = sdf.format(d);<br />         return dateString;<br />     }<br />     <br />     <br />     <br />     /**<br />       获取当前旉<br />     */<br />     public static final String getCurrentFormatDate()<br />     {<br />         Date d = new Date();<br />         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);<br />         String dateString = sdf.format(d);<br />         return dateString;<br />     }<br />     <br />     /**<br />       获取资源文g内容<br />       import org.apache.struts.util.MessageResources;<br />       import org.apache.struts.util.PropertyMessageResourcesFactory;<br />     */<br />     public static String getMessage(String resourceName, String messageName)<br />     {<br />         MessageResources resource = (new PropertyMessageResourcesFactory()).createResources(resourceName);<br />         String value = resource.getMessage(messageName);<br />         if(value == null)<br />             value = "";<br />         return value;<br />     }</p> <img src ="http://www.aygfsteel.com/jesson2005/aggbug/153319.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jesson2005/" target="_blank">张金?/a> 2007-10-16 16:55 <a href="http://www.aygfsteel.com/jesson2005/articles/153319.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>杂议java知识http://www.aygfsteel.com/jesson2005/articles/115886.html张金?/dc:creator>张金?/author>Tue, 08 May 2007 03:16:00 GMThttp://www.aygfsteel.com/jesson2005/articles/115886.htmlhttp://www.aygfsteel.com/jesson2005/comments/115886.htmlhttp://www.aygfsteel.com/jesson2005/articles/115886.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/115886.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/115886.html在windowsq_下,按回车会(x)'\r','\n'两个字符Q而在linux下只产生一?\n'字符

StringcdStringBuffer(StringBuilder)c?br>1 Stringcd象中的内容一但初始化׃能再改变?br>2 StringBuffercȝ于封装内容可以改变的字符丌Ӏ用toString()Ҏ(gu)转换成Stringcd?br>3 StringBuilderc?JDK1.5新加的类)实现了和StringBuffer的同L(fng)功能Q它的操作速度更快Q但它不保证多线E的安全性,所以如果它门不参与多线E推荐用StringBuilderc,而参与多U程推荐使用StringBufferc?
4 String中提供的一些改变内容的Ҏ(gu)Q实际上都是调用了StringBuffercȝҎ(gu)。String="a"+1+"b";~译时等效于String x=new StringBuffer().append("a").append(a).append("b").toString();
5 字符串常量,实际上是一中特D的匿名String对象Q用字W串帔R有时可以节省内存I间?br>String(byte[] bytes, int offset, int length) //构造函数将byte[]转换成stringcd
public String substring(int beginIndex,int endIndex)//从beginIndex开始截取到endIndex-1为止Q截取的长度为endIndex-beginIndex.

数据cd与包装类
boolean---Boolean  byte---Byte char--Character short--Short  int--Integer  long--Long  float--Float  double--Double
基本数据cd不具有对象的Ҏ(gu),而包装类h对象的特性?br>String--->Integer的方?nbsp; new Integer(String str);Integer.valueOf(str);
Integer--->int的方?nbsp; Integer.intValue();
String--->int的三个方法,Integer.parseInt(str);new Integer(String str).intValue;Integer.valueOf(str).intValue();
int--->String    String.valueOf(int);

集合c?br>集合cȝ于存储一l对象,其中的每个对象称之ؓ(f)元素Q经怼(x)用到的有Vector,Enumeration,ArrayList,Collection,Iterator,Set,List{集合类和接口。Enumeration,Collection,Iterator,set,Listq些接口不是集合c,而是提供了各U方法来操作集合cd象?/font>

VectorcMEnumeration接口
Vector v=new Vector;
Emumeration e=v.elements();
while(e.hasMoreElements())
{
 e.nextElement();
}
Enumeration是个接口c,可以从各U数据类型中取出元素?/font>

Collection接口与Iterator接口?br>ArraryList是实现Collection接口的类?br>ArrayList与Vector的区?
ArrayList没有实现U程的同步,而Vector实现了线E的同步Q但ArrayList的执行效率比Vector高,所以程序不存在U程安全问题时应使用ArrayList.

Collection,Set,List的区别:(x)
Collection是Set,List的父c,Collection各元素对象之间没有指定的序Q允许有重复元素和多个null元素对象?br>Set各元素对象之间没有指定的序Q不允许有重复元素,最多允许有一个叫null的元素对象?br>List各元素对象之间有指定的顺序,允许有重复元素和多个null元素对象?/font>

Hashtablec?br>Hashtable是高U数据结构,可以快速检索数据,动态存储一pd的对象,对存储的每一个对??都要安排另一个对?UCؓ(f)关键?与之相关联?br>存储数据:Hashtable.put(Object key,Object value) 值和关键字可一是Q何非I的对象。存储数据时如关键字相同Q则原来的那个D覆盖掉?br>(g)索数?Hashtable.get(Object key) 用作关键字的cd覆盖Object.hashCodeҎ(gu)和Object.equalsҎ(gu).
StringcȝhashCode已经覆盖了关键字cȝhashCodeQ只要两个字W串相等Q他们的hashCode也相{。但StringBuffercL有覆盖关键字cȝhashCode.

Propertiesc?br>1 PropetiescLHashtable的子c?br>2 增加了将Hashtable对象中的关键字和g存到文g和从文g中读取关键字和值到Hashtable对象中的Ҏ(gu)?br>3 如果要用Properties.store(FileOutputStream out,String str)Ҏ(gu)存储Properties对象中的内容Q每个属性的关键字和值多必须是Stringcd的。从文g中装载数据用的是Properties.load()Ҏ(gu)?br>4 Properties.get()Ҏ(gu)q回的是Objectcd的,Properties.getProperty(..)q回的是Stringcd的。Properties.setProperty(...)的参数类型必LStringcd.(取得或设|Properties中的?

System与Runtimec?br>SystemcM所有的成员都是静态的Q?br>1 exit(int status)提前l止虚拟机的q行Q正常操作传递的参数?Q异常终止传递的是非零倹{?br>2 currentTimeMillisҎ(gu)q回的是一个自1970q?????Uv的以毫秒为单位的long 型的大数字?br>3 Java虚拟机的pȝ属性:(x)System.getProperties()和System.setProperties()Ҏ(gu)分别取得和设|Java虚拟机的pȝ属性。Enumeration e=System.getProperties().propertyNames();

Runtimec?br>装了Java虚拟E,一个Java虚拟机对应一个Runtime实例对象Q不能直接创Z个对象,通过Runtime.getRuntime()Ҏ(gu)q回一个Runtime的实例对象的引用。用execҎ(gu)可以启动一个子q程q回的是一个Process的对象。例QProcess p=Runtime.getRuntime().exec("notepad.exe Test.java");参数E名和用该进E打开文g名?/font>



]]>
发送邮?/title><link>http://www.aygfsteel.com/jesson2005/articles/104270.html</link><dc:creator>张金?/dc:creator><author>张金?/author><pubDate>Fri, 16 Mar 2007 07:28:00 GMT</pubDate><guid>http://www.aygfsteel.com/jesson2005/articles/104270.html</guid><wfw:comment>http://www.aygfsteel.com/jesson2005/comments/104270.html</wfw:comment><comments>http://www.aygfsteel.com/jesson2005/articles/104270.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jesson2005/comments/commentRss/104270.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jesson2005/services/trackbacks/104270.html</trackback:ping><description><![CDATA[     摘要: 1 /** */ /**   2  *    3   */   4 ...  <a href='http://www.aygfsteel.com/jesson2005/articles/104270.html'>阅读全文</a><img src ="http://www.aygfsteel.com/jesson2005/aggbug/104270.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jesson2005/" target="_blank">张金?/a> 2007-03-16 15:28 <a href="http://www.aygfsteel.com/jesson2005/articles/104270.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>文g上传http://www.aygfsteel.com/jesson2005/articles/104268.html张金?/dc:creator>张金?/author>Fri, 16 Mar 2007 07:27:00 GMThttp://www.aygfsteel.com/jesson2005/articles/104268.htmlhttp://www.aygfsteel.com/jesson2005/comments/104268.htmlhttp://www.aygfsteel.com/jesson2005/articles/104268.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/104268.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/104268.html  1 package  com.stt.doss.common.util.upload;
 2
 3 import  java.io.BufferedInputStream;
 4 import  java.io.BufferedOutputStream;
 5 import  java.io.File;
 6 import  java.io.FileNotFoundException;
 7 import  java.io.FileOutputStream;
 8 import  java.io.IOException;
 9 import  java.io.InputStream;
10 import  java.io.OutputStream;
11
12 import  org.apache.commons.logging.Log;
13 import  org.apache.commons.logging.LogFactory;
14 import  org.apache.struts.upload.FormFile;
15
16 /**
17  * <p>
18  * Title:
19  * </p>
20  * <p>
21  * Description:
22  * </p>
23  * <p>
24  * Copyright: Copyright (c) 2006
25  * </p>
26  * <p>
27  * Company: stt
28  * </p>
29  *
30  *  @author  william
31  *  @version  1.0
32   */

33 public   class  UploadHelper  {
34
35      private   static  Log log  =  LogFactory.getLog(UploadHelper. class );
36
37      public   static   void  uploadFileForm(FormFile formFile, String folderPath,
38             String fileName)  {
39         log.info( " UploadHelper() uploadFileForm start. " );
40          //  retrieve the file data
41         InputStream inputStream  =   null ;
42         OutputStream outputStream  =   null ;
43
44          int  bytesRead  =   0 ;
45          byte [] buffer  =   new   byte [ 8192 ];
46
47         File file  =   new  File(folderPath);
48          if  ( ! file.exists())  {
49              boolean  f  =  file.mkdir();
50              if  ( ! f)  {
51                 f  =  file.mkdirs();
52                  if  ( ! f)  {
53
54                 }

55             }

56
57         }

58
59          try   {
60             StringBuffer filePath  =   new  StringBuffer();
61             filePath.append(folderPath);
62             filePath.append(File.separator);
63             filePath.append(fileName);
64
65             inputStream  =   new  BufferedInputStream(formFile.getInputStream(),
66                      2048 );
67             outputStream  =   new  BufferedOutputStream( new  FileOutputStream(
68                     filePath.toString()),  2048 );
69
70              //  read and write
71              while  ((bytesRead  =  inputStream.read(buffer,  0 8192 ))  !=   - 1 {
72                 outputStream.write(buffer,  0 , bytesRead);
73             }

74         }
  catch  (FileNotFoundException fnfe)  {
75             fnfe.printStackTrace();
76         }
  catch  (IOException ioe)  {
77             ioe.printStackTrace();
78         }
  finally   {
79              try   {
80                  //  close the stream
81                 outputStream.close();
82                 inputStream.close();
83             }
  catch  (IOException ioe)  {
84                 ioe.printStackTrace();
85             }

86              //  destroy the temporary file
87             formFile.destroy();
88         }

89
90     }
  //  end uploadFileForm
91
92      public   static   void  deleteFile(String path)  {
93         log.info( " UploadHelper() deleteFile start. " );
94         File file  =   new  File(path);
95         file.delete();
96     }

97 }

98

]]>
文g下蝲http://www.aygfsteel.com/jesson2005/articles/104265.html张金?/dc:creator>张金?/author>Fri, 16 Mar 2007 07:26:00 GMThttp://www.aygfsteel.com/jesson2005/articles/104265.htmlhttp://www.aygfsteel.com/jesson2005/comments/104265.htmlhttp://www.aygfsteel.com/jesson2005/articles/104265.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/104265.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/104265.html  1 package  com.stt.doss.common.util.upload;
 2
 3 import  java.io.BufferedOutputStream;
 4 import  java.io.FileInputStream;
 5 import  java.io.FileNotFoundException;
 6 import  java.io.IOException;
 7 import  java.io.UnsupportedEncodingException;
 8
 9 import  javax.servlet.http.HttpServletResponse;
10
11 import  com.stt.doss.util.Convertor;
12
13 /**
14  * <p>
15  * Title:
16  * </p>
17  * <p>
18  * Description:处理下蝲文g工具c?br /> 19  * </p>
20  * <p>
21  * Copyright: Copyright (c) 2006
22  * </p>
23  * <p>
24  * Company: stt
25  * </p>
26  * 
27  *  @author  william
28  *  @version  1.0
29   */

30 public   class  DownloadHelper  {
31
32      /**
33      * 下蝲文g
34      * 
35      *  @param  response
36      *  @param  fileName
37      *  @param  filePath
38       */

39      public   static   void  downloadFile(HttpServletResponse response, String fileName,
40             String fileAllPath)  {
41
42         StringBuffer sb  =   new  StringBuffer( 150 );
43         sb.append( " attachment;  filename= " );
44         sb.append(Convertor.iso2gbk(fileName));
45
46          if  ( null   !=  fileAllPath  &&  fileName  !=   null {
47             FileInputStream fis  =   null ;
48             BufferedOutputStream bos  =   null ;
49              try   {
50                 response
51                         .setContentType( " application/x-msdownload;charset=GB2312 " );
52
53                 response.setHeader( " Content-Disposition " new  String(sb
54                         .toString().getBytes(),  " ISO-8859-1 " ));
55                 fis  =   new  FileInputStream(Convertor.iso2gbk(fileAllPath));
56                 bos  =   new  BufferedOutputStream(response.getOutputStream());
57                  byte [] buffer  =   new   byte [ 2048 ];
58                  while  (fis.read(buffer)  !=   - 1 {
59                     bos.write(buffer);
60                 }

61                 bos.write(buffer,  0 , buffer.length);
62                  //  fis.close();
63                  //  bos.close();
64             }
  catch  (UnsupportedEncodingException e)  {
65                  //  TODO Auto-generated catch block
66                 e.printStackTrace();
67                  throw   new  RuntimeException();
68             }
  catch  (FileNotFoundException e)  {
69                  //  TODO Auto-generated catch block
70                 e.printStackTrace();
71                  throw   new  RuntimeException();
72             }
  catch  (IOException e)  {
73                  //  TODO Auto-generated catch block
74                 e.printStackTrace();
75                  throw   new  RuntimeException();
76             }
  finally   {
77                  try   {
78                      if  (fis  !=   null {
79                         fis.close();
80                     }

81                      if  (bos  !=   null {
82                         bos.close();
83                     }

84                 }
  catch  (IOException e)  {
85                      //  TODO Auto-generated catch block
86                     e.printStackTrace();
87                      throw   new  RuntimeException();
88                 }

89
90             }

91         }

92
93     }

94 }

95

]]>
前台分页http://www.aygfsteel.com/jesson2005/articles/104264.html张金?/dc:creator>张金?/author>Fri, 16 Mar 2007 07:25:00 GMThttp://www.aygfsteel.com/jesson2005/articles/104264.htmlhttp://www.aygfsteel.com/jesson2005/comments/104264.htmlhttp://www.aygfsteel.com/jesson2005/articles/104264.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/104264.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/104264.html阅读全文

]]>
字符串变数组http://www.aygfsteel.com/jesson2005/articles/104261.html张金?/dc:creator>张金?/author>Fri, 16 Mar 2007 07:24:00 GMThttp://www.aygfsteel.com/jesson2005/articles/104261.htmlhttp://www.aygfsteel.com/jesson2005/comments/104261.htmlhttp://www.aygfsteel.com/jesson2005/articles/104261.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/104261.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/104261.html  1 package  com.stt.doss.common.util;
 2
 3 import  java.util.StringTokenizer;
 4
 5 public   class  StringUtils  {
 6      public   static  String[] str2Array(String str,String s)  {
 7          if (str == null {
 8              return   null ;
 9         }

10         StringTokenizer st = new  StringTokenizer(str,s);
11         String[] strs = new  String[st.countTokens()];
12          int  i = 0 ;
13          while (st.hasMoreTokens())  {
14             strs[i] = st.nextToken();
15             i ++ ;
16         }

17
18          return  strs;
19     }

20
21 }


]]>
去除所有引L(fng)操作http://www.aygfsteel.com/jesson2005/articles/98578.html张金?/dc:creator>张金?/author>Wed, 07 Feb 2007 05:23:00 GMThttp://www.aygfsteel.com/jesson2005/articles/98578.htmlhttp://www.aygfsteel.com/jesson2005/comments/98578.htmlhttp://www.aygfsteel.com/jesson2005/articles/98578.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/98578.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/98578.html//先去? ",得到"...................................."q样的一个字W串,然后再去除一头一引号
public static void replaceChar(String s){
        //String s = "01290943050280128550\" \"01\" \"0\" \"13548418074\" \"923041\" \"13548418074\" \"1862      \" \"1862SMS   \" \"01\" \"0     \" \"0     \" \"0      \" \"0\" \"85 \" \"280 \" \"002801\" \"      \" \"13800280500\" \"20070129094305\" \"20070129094314\" \"PXY08 \" \"0";
        String ss = s.replaceAll("\" \"","");
        System.out.println(" ss ="+ss);
        ss = ss.replaceAll("\"","");
        System.out.println(" ss ="+ss);
    }

 public static void readFile(){
        try{
            File file = new File("D:\\dosp\\t.txt");
            java.io.FileReader reader = new FileReader(file);

            BufferedReader br = new BufferedReader(reader);
            String s = br.readLine();
            System.out.println(" s = " + s);
            replaceChar(s);
        }catch(Exception e){
            e.printStackTrace();
        }
    }
 public static void main(String[] args) {
        Test test = new Test();
        readFile();
    }

以下是在文本t.txt中的例子(处于一?每个字段用引h?各个字段之间有空?

"01282356000280118304" "01" "0" "           " "923084" "13466390573" "5198      " "-GSSP     " "03" "0     " "1500  " "DB:0115" "1" "101" "    " "002801" "      " "13800280500" "20070128235602" "20070128235602" "Agent0" "0         "

q过上面函数处理后得?
W一步得?
"01282356000280118304010           923084134663905735198      -GSSP     030     1500  DB:01151101    002801      138002805002007012823560220070128235602Agent00         "

W二步得?
01282356000280118304010           923084134663905735198      -GSSP     030     1500  DB:01151101    002801      138002805002007012823560220070128235602Agent00        



]]>
与数据库操作相关的工L(fng)http://www.aygfsteel.com/jesson2005/articles/98537.html张金?/dc:creator>张金?/author>Wed, 07 Feb 2007 03:11:00 GMThttp://www.aygfsteel.com/jesson2005/articles/98537.htmlhttp://www.aygfsteel.com/jesson2005/comments/98537.htmlhttp://www.aygfsteel.com/jesson2005/articles/98537.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/98537.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/98537.html阅读全文

]]>
校验工具c?/title><link>http://www.aygfsteel.com/jesson2005/articles/98534.html</link><dc:creator>张金?/dc:creator><author>张金?/author><pubDate>Wed, 07 Feb 2007 03:02:00 GMT</pubDate><guid>http://www.aygfsteel.com/jesson2005/articles/98534.html</guid><wfw:comment>http://www.aygfsteel.com/jesson2005/comments/98534.html</wfw:comment><comments>http://www.aygfsteel.com/jesson2005/articles/98534.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jesson2005/comments/commentRss/98534.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jesson2005/services/trackbacks/98534.html</trackback:ping><description><![CDATA[     摘要: 1 package  com.stt.dosp.datacollect.util;   2   3 // import java.io.BufferedReader;   4 ...  <a href='http://www.aygfsteel.com/jesson2005/articles/98534.html'>阅读全文</a><img src ="http://www.aygfsteel.com/jesson2005/aggbug/98534.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jesson2005/" target="_blank">张金?/a> 2007-02-07 11:02 <a href="http://www.aygfsteel.com/jesson2005/articles/98534.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>处理字符串将其中?' 转换为内容,卛_上{义符?/title><link>http://www.aygfsteel.com/jesson2005/articles/98533.html</link><dc:creator>张金?/dc:creator><author>张金?/author><pubDate>Wed, 07 Feb 2007 03:00:00 GMT</pubDate><guid>http://www.aygfsteel.com/jesson2005/articles/98533.html</guid><wfw:comment>http://www.aygfsteel.com/jesson2005/comments/98533.html</wfw:comment><comments>http://www.aygfsteel.com/jesson2005/articles/98533.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jesson2005/comments/commentRss/98533.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jesson2005/services/trackbacks/98533.html</trackback:ping><description><![CDATA[ <p> /**<br />     * q行SQL字符串的规则化?br />     * 目前只处理将其中?转换为内容,卛_上{义符?br />     */<br />    public static String normalizeString(String sql){<br />        // 在null的情况下Q返?"Q以便插入数据库?br />        // 因ؓ(f)null在数据库中插入后成ؓ(f)"null"Q不正确?br />        if ( (null == sql) || ("".equals(sql)) )<br />            return "";</p> <p>        int lastIndex = sql.lastIndexOf("'");<br />        if ( lastIndex < 0 )<br />            return sql;<br />        if ( 0 == lastIndex )<br />            return "'" + sql;</p> <p>        int[] sepIndexArray = new int[lastIndex + 1 + 2];<br />        sepIndexArray[0] = 0;</p> <p>        int startIndex = -1;<br />        int sepIndex = 1;<br />        while ( (startIndex = sql.indexOf("'", startIndex + 1)) >= 0 )<br />            sepIndexArray[sepIndex++] = startIndex;</p> <p>        sepIndexArray[sepIndex] = sql.length();</p> <p>        String result = sql.substring(sepIndexArray[0], sepIndexArray[1]);<br />        for ( int i = 1; i < sepIndex; i++ )<br />            result = result<br />                + "'" + sql.substring(sepIndexArray[i], sepIndexArray[i + 1]);</p> <p>        return result;<br />    }</p> <img src ="http://www.aygfsteel.com/jesson2005/aggbug/98533.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jesson2005/" target="_blank">张金?/a> 2007-02-07 11:00 <a href="http://www.aygfsteel.com/jesson2005/articles/98533.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>格式化日?/title><link>http://www.aygfsteel.com/jesson2005/articles/98531.html</link><dc:creator>张金?/dc:creator><author>张金?/author><pubDate>Wed, 07 Feb 2007 02:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/jesson2005/articles/98531.html</guid><wfw:comment>http://www.aygfsteel.com/jesson2005/comments/98531.html</wfw:comment><comments>http://www.aygfsteel.com/jesson2005/articles/98531.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jesson2005/comments/commentRss/98531.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jesson2005/services/trackbacks/98531.html</trackback:ping><description><![CDATA[/**<br />  * 格式化日?<br />  * */<br />    public static String formatTime( Calendar cal, String format ){<br />        SimpleDateFormat localTimeFormatter<br />            = new SimpleDateFormat(format);<br />        return localTimeFormatter.format(cal.getTime());<br />    }<br />    /**<br />  * 格式化日?<br />  * */<br />    public static Calendar formatDate( String time, String format ){<br />        try{<br />            Date d = new Date();<br />            SimpleDateFormat timeFormatter1<br />                = new SimpleDateFormat(format);<br />            d = timeFormatter1.parse(time);<br />            Calendar cal = Calendar.getInstance();<br />            cal.setTime(d);<br />            return cal;<br />        }catch ( Exception ex ){<br />            log.error("error: ", ex);<br />            return Calendar.getInstance();<br />        }<br />    }<img src ="http://www.aygfsteel.com/jesson2005/aggbug/98531.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jesson2005/" target="_blank">张金?/a> 2007-02-07 10:59 <a href="http://www.aygfsteel.com/jesson2005/articles/98531.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>分割字符?先去除所有空?再去引号操作http://www.aygfsteel.com/jesson2005/articles/98529.html张金?/dc:creator>张金?/author>Wed, 07 Feb 2007 02:57:00 GMThttp://www.aygfsteel.com/jesson2005/articles/98529.htmlhttp://www.aygfsteel.com/jesson2005/comments/98529.htmlhttp://www.aygfsteel.com/jesson2005/articles/98529.html#Feedback0http://www.aygfsteel.com/jesson2005/comments/commentRss/98529.htmlhttp://www.aygfsteel.com/jesson2005/services/trackbacks/98529.html    /**
  * 分割字符?先去除所有空?再去引号操作
  * */
 protected String[] splitString(String lineString){
   ArrayList list = new ArrayList();
   StringBuffer sb = new StringBuffer();
   String[] temp_columnArray = null;
   String[] columnArray = null;
   //字符串如果含有空|则空gؓ(f)“半角状态下的空格”,如果为全角状态下Q则I格长度?
   lineString = lineString.trim();  
   char[] chars = lineString.toCharArray();
   int length = chars.length;
   for(int i = 0; i < chars.length; i++){ 
    if(String.valueOf(chars[i]).trim().length()<1){    
     length --;
    }else{
     sb.append(String.valueOf(chars[i]));
    }
   }
         System.out.println(sb.toString());
         String str = sb.toString();
         temp_columnArray = str.split("['\"']");
         for(int i = 0; i < temp_columnArray.length; i++){
          if(temp_columnArray[i].trim().length()>=1){
           list.add(temp_columnArray[i]);
          }
         }
         columnArray = (String[])list.toArray(new String[(temp_columnArray.length/2)-1]);
         System.out.println(columnArray.length);
         for(int i = 0; i < columnArray.length; i++){
          System.out.println(columnArray[i]);
         }
  return columnArray;
 }

字符串范?处于一行中,q且每个字段有引?: "01290943050280128550" "01" "0" "13548418074" "923041" "13548418074" "1862      " "1862SMS   " "01" "0     " "0     " "0      " "0" "85 " "280 " "002801" "   33   " "13800280500" "20070129094305" "20070129094314" "PXY08 " "0         "

]]>
分割字符?去除字符串中的所有空?/title><link>http://www.aygfsteel.com/jesson2005/articles/98522.html</link><dc:creator>张金?/dc:creator><author>张金?/author><pubDate>Wed, 07 Feb 2007 02:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/jesson2005/articles/98522.html</guid><wfw:comment>http://www.aygfsteel.com/jesson2005/comments/98522.html</wfw:comment><comments>http://www.aygfsteel.com/jesson2005/articles/98522.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jesson2005/comments/commentRss/98522.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jesson2005/services/trackbacks/98522.html</trackback:ping><description><![CDATA[ /**<br />  * 分割字符?去除字符串中的所有空?--1<br />  * */<br /> protected String[] splitString(String lineString){<br />   ArrayList list = new ArrayList();<br />   String[] columnArray = null;<br />   //字符串如果含有空|则空gؓ(f)“半角状态下的空格”,如果为全角状态下Q则I格长度?<br />//   String lineString = "        z   j   p  ";<br />   lineString = lineString.trim();   <br />   char[] chars = lineString.toCharArray();<br />   int length = chars.length;<br />   for(int i = 0; i < chars.length; i++){ <br />    if(String.valueOf(chars[i]).trim().length()<1){    <br />     length --;<br />    }else{<br />     list.add(String.valueOf(chars[i]));<br />    }<br />   }<br />   columnArray = (String[])list.toArray(new String[length]);<br />       <br />  return columnArray;<br /> }<br /><br /><br />例如lineString ="        z   j   p  ", 则最后的columnArray数组内容为{z,j,p},长度?<img src ="http://www.aygfsteel.com/jesson2005/aggbug/98522.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jesson2005/" target="_blank">张金?/a> 2007-02-07 10:49 <a href="http://www.aygfsteel.com/jesson2005/articles/98522.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">ԫ</a>| <a href="http://" target="_blank">¤</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ϰ</a>| <a href="http://" target="_blank">˫</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank">º</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ǭ</a>| <a href="http://" target="_blank">ϽϽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">½</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ײ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">׿</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ᶫ</a>| <a href="http://" target="_blank">찲</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">޻</a>| <a href="http://" target="_blank">Ӵ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>