﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-zhxsh-文章分类-java</title><link>http://www.blogjava.net/zhxsh/category/20733.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 19 Mar 2007 18:08:46 GMT</lastBuildDate><pubDate>Mon, 19 Mar 2007 18:08:46 GMT</pubDate><ttl>60</ttl><item><title>java.util.ArrayList </title><link>http://www.blogjava.net/zhxsh/articles/103693.html</link><dc:creator>张小山</dc:creator><author>张小山</author><pubDate>Wed, 14 Mar 2007 01:14:00 GMT</pubDate><guid>http://www.blogjava.net/zhxsh/articles/103693.html</guid><wfw:comment>http://www.blogjava.net/zhxsh/comments/103693.html</wfw:comment><comments>http://www.blogjava.net/zhxsh/articles/103693.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/zhxsh/comments/commentRss/103693.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/zhxsh/services/trackbacks/103693.html</trackback:ping><description><![CDATA[
		<p class="postTitle">€   数组和数组列表之间有着重大的区别。数组是Java语言的一个特征，对于每个元素类型T，都有数组类型T[];然而，ArrayList类是个定义java.util包中的类库。这是一个存放object类型元素的"普通性"的类型。要注意的是，要从数组列表中提取元素时，需要进行类型转换。<br />  使用add方法可以向数组列表中添加新元素：<br />   ArrayList staff = new ArrayList();<br />   staff.add(new Employee(....));<br />   staff.add(new Employee(....));<br />   ArrayList类管理了一个Object引用的内部数组。最终，可能会用完数组的空间。如果调用了add，而内部数组已经满了，数组列表将自动创建了一个更大的数组，并自动把小数组中的对象拷贝到大数组中<br />  Size方法返回数组列表的实际元素个数<br />    staff.size()    它等价于数组a的a.length   <br />   访问数组列表元素<br />因为 ArrayList类不是Java语言的一部分，它只是个提供在标准库中、由某人编写的工具类，并不像在访问数组元素时可以使用[]语法那样，要存取或改变数组元素，你必须使用get和set方法<br />   要设置第i个元素，需要使用：<br />   staff.set(i,harry);<br />得到数组列表元素要更复杂一些，因为get方法返回的类型是Object，你还需要把它转换为想要的类型<br />   Employee e = (Employee)staff.get(i); 它等价于Employee e = a[i];<br /><br />   最后总结一下：<br /> 无需指定数组大小<br />用add增添任意多的元素;<br />用size()代替length计算元素的个数;<br />用(Employee)a.get(i)代替a[i]访问元素i; <br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #0000ff">public</span>
				<span style="COLOR: #000000"> Collection setRollBack(QueueVB job) </span>
				<span style="COLOR: #0000ff">throws</span>
				<span style="COLOR: #000000"> CustomException<br /><img id="Codehighlighter1_67_1427_Open_Image" onclick="this.style.display='none'; Codehighlighter1_67_1427_Open_Text.style.display='none'; Codehighlighter1_67_1427_Closed_Image.style.display='inline'; Codehighlighter1_67_1427_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_67_1427_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_67_1427_Closed_Text.style.display='none'; Codehighlighter1_67_1427_Open_Image.style.display='inline'; Codehighlighter1_67_1427_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span>
				<span id="Codehighlighter1_67_1427_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
						<img src="http://www.blogjava.net/images/dot.gif" />
				</span>
				<span id="Codehighlighter1_67_1427_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        String sqlselect </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">select FileName from JobQueue where BatchNum=</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">job.getBatchNum()</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000"> and DocTypeID=</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">job.getDocTypeID()</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">and JobState='6'</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        String sql </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">update JobQueue set JobState=</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">JobState.SAVE</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000"> where BatchNum=</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">job.getBatchNum()</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000"> and DocTypeID=</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">job.getDocTypeID()</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000"> and JobNum=</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">job.getJobNum()</span>
						<span style="COLOR: #000000">+</span>
						<span style="COLOR: #000000">""</span>
						<span style="COLOR: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        <font color="#ff1493">ArrayList array</font></span>
						<font color="#ff1493">
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #0000ff">new</span>
						</font>
						<span style="COLOR: #000000">
								<font color="#ff1493"> ArrayList();</font>
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(sql);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span>
						<span style="COLOR: #0000ff">try</span>
						<span style="COLOR: #000000">
								<br />
								<img id="Codehighlighter1_460_1321_Open_Image" onclick="this.style.display='none'; Codehighlighter1_460_1321_Open_Text.style.display='none'; Codehighlighter1_460_1321_Closed_Image.style.display='inline'; Codehighlighter1_460_1321_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
								<img id="Codehighlighter1_460_1321_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_460_1321_Closed_Text.style.display='none'; Codehighlighter1_460_1321_Open_Image.style.display='inline'; Codehighlighter1_460_1321_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span>
						<span id="Codehighlighter1_460_1321_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_460_1321_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                    getConnection</span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000">ConnectionLocator.getInstance().getConnection(strJNDI);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                    ResultSet rs</span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #0000ff">null</span>
								<span style="COLOR: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                    </span>
								<span style="COLOR: #0000ff">if</span>
								<span style="COLOR: #000000">(getConnection</span>
								<span style="COLOR: #000000">!=</span>
								<span style="COLOR: #0000ff">null</span>
								<span style="COLOR: #000000">)<br /><img id="Codehighlighter1_595_1315_Open_Image" onclick="this.style.display='none'; Codehighlighter1_595_1315_Open_Text.style.display='none'; Codehighlighter1_595_1315_Closed_Image.style.display='inline'; Codehighlighter1_595_1315_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_595_1315_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_595_1315_Closed_Text.style.display='none'; Codehighlighter1_595_1315_Open_Image.style.display='inline'; Codehighlighter1_595_1315_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                    </span>
								<span id="Codehighlighter1_595_1315_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
										<img src="http://www.blogjava.net/images/dot.gif" />
								</span>
								<span id="Codehighlighter1_595_1315_Open_Text">
										<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        PreparedStatement pstmt1</span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000">getConnection.prepareStatement(sqlselect);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        PreparedStatement pstmt</span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000">getConnection.prepareStatement(sql);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        rs </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> pstmt1.executeQuery();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        pstmt.executeUpdate();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        </span>
										<span style="COLOR: #0000ff">while</span>
										<span style="COLOR: #000000">(rs.next())<br /><img id="Codehighlighter1_837_1034_Open_Image" onclick="this.style.display='none'; Codehighlighter1_837_1034_Open_Text.style.display='none'; Codehighlighter1_837_1034_Closed_Image.style.display='inline'; Codehighlighter1_837_1034_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_837_1034_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_837_1034_Closed_Text.style.display='none'; Codehighlighter1_837_1034_Open_Image.style.display='inline'; Codehighlighter1_837_1034_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                        </span>
										<span id="Codehighlighter1_837_1034_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
												<img src="http://www.blogjava.net/images/dot.gif" />
										</span>
										<span id="Codehighlighter1_837_1034_Open_Text">
												<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                           <font color="#ff1493"> String fileName </font></span>
												<font color="#ff1493">
														<span style="COLOR: #000000">=</span>
														<span style="COLOR: #000000"> rs.getString(</span>
														<span style="COLOR: #000000">"</span>
														<span style="COLOR: #000000">FileName</span>
														<span style="COLOR: #000000">"</span>
												</font>
												<font color="#ff1493">
														<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                            FileNameVB filenameVB </span>
														<span style="COLOR: #000000">=</span>
														<span style="COLOR: #000000"> </span>
														<span style="COLOR: #0000ff">new</span>
												</font>
												<span style="COLOR: #000000">
														<font color="#ff1493"> FileNameVB();//将得到的“文件名“进行封装<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                            filenameVB.setFileName(fileName);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                            array.add(filenameVB);<br /></font>
														<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                        }</span>
										</span>
										<span style="COLOR: #000000">
												<br />
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        </span>
										<span style="COLOR: #0000ff">try</span>
										<span style="COLOR: #000000">
												<br />
												<img id="Codehighlighter1_1052_1082_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1052_1082_Open_Text.style.display='none'; Codehighlighter1_1052_1082_Closed_Image.style.display='inline'; Codehighlighter1_1052_1082_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
												<img id="Codehighlighter1_1052_1082_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1052_1082_Closed_Text.style.display='none'; Codehighlighter1_1052_1082_Open_Image.style.display='inline'; Codehighlighter1_1052_1082_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                        </span>
										<span id="Codehighlighter1_1052_1082_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
												<img src="http://www.blogjava.net/images/dot.gif" />
										</span>
										<span id="Codehighlighter1_1052_1082_Open_Text">
												<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                            pstmt.close();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                        }</span>
										</span>
										<span style="COLOR: #000000">
												<br />
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        </span>
										<span style="COLOR: #0000ff">catch</span>
										<span style="COLOR: #000000">(SQLException e)<br /><img id="Codehighlighter1_1118_1167_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1118_1167_Open_Text.style.display='none'; Codehighlighter1_1118_1167_Closed_Image.style.display='inline'; Codehighlighter1_1118_1167_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1118_1167_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1118_1167_Closed_Text.style.display='none'; Codehighlighter1_1118_1167_Open_Image.style.display='inline'; Codehighlighter1_1118_1167_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                        </span>
										<span id="Codehighlighter1_1118_1167_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
												<img src="http://www.blogjava.net/images/dot.gif" />
										</span>
										<span id="Codehighlighter1_1118_1167_Open_Text">
												<span style="COLOR: #000000">{</span>
												<span style="COLOR: #0000ff">throw</span>
												<span style="COLOR: #000000"> </span>
												<span style="COLOR: #0000ff">new</span>
												<span style="COLOR: #000000"> CustomException(e.getMessage(),</span>
												<span style="COLOR: #000000">"</span>
												<span style="COLOR: #000000">exs</span>
												<span style="COLOR: #000000">"</span>
												<span style="COLOR: #000000">);}</span>
										</span>
										<span style="COLOR: #000000">
												<br />
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        </span>
										<span style="COLOR: #0000ff">try</span>
										<span style="COLOR: #000000">
												<br />
												<img id="Codehighlighter1_1185_1223_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1185_1223_Open_Text.style.display='none'; Codehighlighter1_1185_1223_Closed_Image.style.display='inline'; Codehighlighter1_1185_1223_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
												<img id="Codehighlighter1_1185_1223_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1185_1223_Closed_Text.style.display='none'; Codehighlighter1_1185_1223_Open_Image.style.display='inline'; Codehighlighter1_1185_1223_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                        </span>
										<span id="Codehighlighter1_1185_1223_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
												<img src="http://www.blogjava.net/images/dot.gif" />
										</span>
										<span id="Codehighlighter1_1185_1223_Open_Text">
												<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                            getConnection.close();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                        }</span>
										</span>
										<span style="COLOR: #000000">
												<br />
												<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        </span>
										<span style="COLOR: #0000ff">catch</span>
										<span style="COLOR: #000000">(SQLException e)<br /><img id="Codehighlighter1_1259_1308_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1259_1308_Open_Text.style.display='none'; Codehighlighter1_1259_1308_Closed_Image.style.display='inline'; Codehighlighter1_1259_1308_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1259_1308_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1259_1308_Closed_Text.style.display='none'; Codehighlighter1_1259_1308_Open_Image.style.display='inline'; Codehighlighter1_1259_1308_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                        </span>
										<span id="Codehighlighter1_1259_1308_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
												<img src="http://www.blogjava.net/images/dot.gif" />
										</span>
										<span id="Codehighlighter1_1259_1308_Open_Text">
												<span style="COLOR: #000000">{</span>
												<span style="COLOR: #0000ff">throw</span>
												<span style="COLOR: #000000"> </span>
												<span style="COLOR: #0000ff">new</span>
												<span style="COLOR: #000000"> CustomException(e.getMessage(),</span>
												<span style="COLOR: #000000">"</span>
												<span style="COLOR: #000000">exs</span>
												<span style="COLOR: #000000">"</span>
												<span style="COLOR: #000000">);}</span>
										</span>
										<span style="COLOR: #000000">
												<br />
												<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                    }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                }</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span>
						<span style="COLOR: #0000ff">catch</span>
						<span style="COLOR: #000000">(SQLException e)<br /><img id="Codehighlighter1_1353_1406_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1353_1406_Open_Text.style.display='none'; Codehighlighter1_1353_1406_Closed_Image.style.display='inline'; Codehighlighter1_1353_1406_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1353_1406_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1353_1406_Closed_Text.style.display='none'; Codehighlighter1_1353_1406_Open_Image.style.display='inline'; Codehighlighter1_1353_1406_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span>
						<span id="Codehighlighter1_1353_1406_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_1353_1406_Open_Text">
								<span style="COLOR: #000000">{</span>
								<span style="COLOR: #0000ff">throw</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">new</span>
								<span style="COLOR: #000000"> CustomException(e.getMessage(),</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">ex00050</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">);}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                </span>
						<span style="COLOR: #0000ff">return</span>
						<span style="COLOR: #000000"> array;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span>
				</span>
		</div>
		<p>读取arraylist里的值 </p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<font color="#ff1493">
						<span style="COLOR: #000000">Collection m  </span>
						<span style="COLOR: #000000">=</span>
				</font>
				<font color="#ff1493">
						<span style="COLOR: #000000"> inputFacade.setRollBack(job);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />                    ArrayList array </span>
						<span style="COLOR: #000000">=</span>
				</font>
				<font color="#ff1493">
						<span style="COLOR: #000000"> (ArrayList)m;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />                    </span>
						<span style="COLOR: #0000ff">for</span>
						<span style="COLOR: #000000">(</span>
						<span style="COLOR: #0000ff">int</span>
						<span style="COLOR: #000000"> i</span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000">0</span>
						<span style="COLOR: #000000">;i</span>
						<span style="COLOR: #000000">&lt;</span>
						<span style="COLOR: #000000">array.size();i</span>
						<span style="COLOR: #000000">++</span>
				</font>
				<font color="#ff1493">
						<span style="COLOR: #000000">)<br /><img id="Codehighlighter1_125_174_Open_Image" onclick="this.style.display='none'; Codehighlighter1_125_174_Open_Text.style.display='none'; Codehighlighter1_125_174_Closed_Image.style.display='inline'; Codehighlighter1_125_174_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_125_174_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_125_174_Closed_Text.style.display='none'; Codehighlighter1_125_174_Open_Image.style.display='inline'; Codehighlighter1_125_174_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />                    </span>
						<span id="Codehighlighter1_125_174_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
				</font>
				<span id="Codehighlighter1_125_174_Open_Text">
						<font color="#ff1493">
								<span style="COLOR: #000000">{   <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />                        filenameVB </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> (FileNameVB)array.get(i);</span>
						</font>
				</span>
		</div>
		<a class="headermaintitle" id="Header1_HeaderTitle" href="/silvernapoleon/">
				<strong>
						<font color="#000000" size="4">
						</font>
				</strong>
		</a>
<img src ="http://www.blogjava.net/zhxsh/aggbug/103693.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/zhxsh/" target="_blank">张小山</a> 2007-03-14 09:14 <a href="http://www.blogjava.net/zhxsh/articles/103693.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>