﻿<?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>博客园-飞茂</title><link>http://www.cnblogs.com/sunsonbaby/</link><description>随便记记</description><language>zh-cn</language><lastBuildDate>Thu, 16 Oct 2008 07:20:13 GMT</lastBuildDate><pubDate>Thu, 16 Oct 2008 07:20:13 GMT</pubDate><ttl>60</ttl><item><title>BlogJava好像不能贴图</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/05/05/149593.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Thu, 05 May 2005 03:38:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/05/05/149593.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/149593.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/05/05/149593.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/149593.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/149593.html</trackback:ping><description><![CDATA[<p>BlogJava好像不能贴图,就贴在这里了.
<br/>
<br/>
<br/><img height="268" src="http://www.cnblogs.com/images/cnblogs_com/sunsonbaby/jsr168_class.jpg" width="639" />
<br/>
<br/>
<br/><img height="1024" src="http://www.cnblogs.com/images/cnblogs_com/sunsonbaby/portal_xml.jpg" width="579" />
<br/>
<br/>
<br/><img height="1024" src="http://www.cnblogs.com/images/cnblogs_com/sunsonbaby/webapp_2.4.jpg" width="413" />
</p><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/149593.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43026/" target="_blank">[新闻]微软与开源</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>应聘技巧</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110361.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Mon, 28 Feb 2005 09:09:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110361.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/110361.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110361.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/110361.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/110361.html</trackback:ping><description><![CDATA[<a href="http://www.start.com.cn/person/guide/02.htm">http://www.start.com.cn/person/guide/02.htm</a>
<br/>
<br/><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/110361.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43025/" target="_blank">[新闻]首届中国优秀软件创新大赛正式启动</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>.net 代码生成</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110315.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Mon, 28 Feb 2005 07:46:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110315.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/110315.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110315.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/110315.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/110315.html</trackback:ping><description><![CDATA[<u><font color="#000080"><a href="http://blog.csdn.net/upto/archive/2004/10/07/126947.aspx">http://blog.csdn.net/upto/archive/2004/10/07/126947.aspx</a></font></u>
<br>
<br><a href="http://dev.csdn.net/user/chenyun2000">http://dev.csdn.net/user/chenyun2000</a><br>
<br>
http://www.pconline.com.cn/pcjob/process/other/others/0408/429815.html<br>
<br>
http://geosoft.pku.edu.cn/blogs/skyswind/archive/2004/11/08/550.aspx<br>
<br>
http://www.cnblogs.com/elevenwolf/archive/2004/12/01/71391.aspx<br>
<br>
http://www.cnblogs.com/keyss/archive/2005/01/24/95707.html<br>
<br>
<br>
<img src ="http://www.cnblogs.com/sunsonbaby/aggbug/110315.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43025/" target="_blank">[新闻]首届中国优秀软件创新大赛正式启动</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>报表相关链接</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110150.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Mon, 28 Feb 2005 03:05:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110150.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/110150.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/28/110150.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/110150.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/110150.html</trackback:ping><description><![CDATA[<a href="http://www.niufish.com/archives/2004/000167.html">http://www.niufish.com/archives/2004/000167.html</a>
<br/>
<br/><a href="http://blog.csdn.net/shaokun305/category/25138.aspx">http://blog.csdn.net/shaokun305/category/25138.aspx</a>
<br/>
<br/><a href="http://www.softhouse.com.cn/html/200410/2004102517080700001332.html">http://www.softhouse.com.cn/html/200410/2004102517080700001332.html</a>
<br/>
<br/><a href="http://www.sentom.net/list.asp?id=71">http://www.sentom.net/list.asp?id=71</a>
<br/>
<br/><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/110150.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43025/" target="_blank">[新闻]首届中国优秀软件创新大赛正式启动</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>WebWork2相关链接</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/27/110033.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Sun, 27 Feb 2005 15:57:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/27/110033.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/110033.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/27/110033.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/110033.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/110033.html</trackback:ping><description><![CDATA[<p><a href="http://jira.opensymphony.com/browse/WW-675">http://jira.opensymphony.com/browse/WW-675</a> 
<br/>
<br/>&#160;<a href="http://xdoclet.codehaus.org/">http://xdoclet.codehaus.org/</a>
</p>
<p></p>
<p>http://www.beust.com/doclipse/</p><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/110033.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43022/" target="_blank">[新闻]2008年10月16日科技博客精选</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Oracle 系统package</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/27/109825.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Sun, 27 Feb 2005 04:39:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/27/109825.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/109825.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/27/109825.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/109825.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/109825.html</trackback:ping><description><![CDATA[<a href="http://fanqiang.chinaunix.net/a2/b2/20010813/0900011113.html">http://fanqiang.chinaunix.net/a2/b2/20010813/0900011113.html</a> 
<br/>
<br/><a href="http://www.google.com/search?hl=zh-CN&amp;newwindow=1&amp;q=oracle+%E7%B3%BB%E7%BB%9F%E5%8C%85&amp;lr=lang_zh-CN%7Clang_zh-TW">http://www.google.com/search?hl=zh-CN&amp;newwindow=1&amp;q=oracle+%E7%B3%BB%E7%BB%9F%E5%8C%85&amp;lr=lang_zh-CN%7Clang_zh-TW</a> 
<br/>
<br/><a href="http://www.google.com/search?q=oracle+DBMS_SQL&amp;hl=zh-CN&amp;lr=lang_zh-CN|lang_zh-TW&amp;newwindow=1&amp;start=10&amp;sa=N">http://www.google.com/search?q=oracle+DBMS_SQL&amp;hl=zh-CN&amp;lr=lang_zh-CN|lang_zh-TW&amp;newwindow=1&amp;start=10&amp;sa=N</a> 
<br/>
<br/><h3>Oracle9i新特性-使用DBMS_METADATA包获得对象DDL语句<a href="http://dev.csdn.net/article/57/57507.shtm">http://dev.csdn.net/article/57/57507.shtm</a> 
<br/>
<p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><span style="FONT-SIZE: 22pt; COLOR: blue; FONT-FAMILY: 微软简楷体; mso-bidi-font-size: 12.0pt">
<br/>关于动态<span lang="EN-US">SQL的使用</span></span><a href="http://blog.csdn.net/dinya2003/archive/2004/11/30/198820.aspx">http://blog.csdn.net/dinya2003/archive/2004/11/30/198820.aspx</a>
<br/>
<br/>
</p></h3><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/109825.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43022/" target="_blank">[新闻]2008年10月16日科技博客精选</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Oracle基本数据类型存储格式浅析（一）——字符类型</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/26/109675.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Sat, 26 Feb 2005 14:07:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/26/109675.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/109675.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/26/109675.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/109675.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/109675.html</trackback:ping><description><![CDATA[<p><a href="http://www.dbonline.cn/source/oracle/20041023/PLSQL_use%20compose%20and%20unistr.htm">http://www.dbonline.cn/source/oracle/20041023/PLSQL_use%20compose%20and%20unistr.htm</a> 
<br/>
<br/><a href="http://www.cnoug.org/archive/index.php/t-43401.html">http://www.cnoug.org/archive/index.php/t-43401.html</a> 
<br/>
<br/><a href="http://searchdatabase.techtarget.com.cn/searchdatabase/504969415343734784/20050126/1905909_1.shtml">http://searchdatabase.techtarget.com.cn/searchdatabase/504969415343734784/20050126/1905909_1.shtml</a> 
<br/>
<br/><a href="http://blog.itpub.net/post/468/9287">http://blog.itpub.net/post/468/9287</a> 
</p>
<p></p>
<p>You can create a table using the NVARCHAR2 and NCHAR datatypes. The column length specified for the NCHAR and NVARCHAR2 columns is always the number of characters instead of the number of bytes: 
<br/>
<br/>对于非nchar或者nvarchar的类型,The column length 应该是the number of bytes 
</p>
<p></p>
<p></p>
<p>http://www.oracle.com.cn/onlinedoc/server.920/a96529/ch6.htm#1011079
<br/>
<br/>
</p><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/109675.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43021/" target="_blank">[新闻]微软ASP.NET MVC Beta版本发布</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>RenderX java的xml打印</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/22/107375.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Tue, 22 Feb 2005 03:27:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/22/107375.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/107375.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/22/107375.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/107375.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/107375.html</trackback:ping><description><![CDATA[<a href="http://www.zdnet.com.cn/techupdate/apply/collaboration/story/0,3800030473,39347913,00.htm">http://www.zdnet.com.cn/techupdate/apply/collaboration/story/0,3800030473,39347913,00.htm</a> 
<br/>
<br/><a href="http://www.renderx.com/demos/index.html">http://www.renderx.com/demos/index.html</a> 
<br/>
<br/>FOP从技术上说无疑是一个非常优秀的产品，但是目前它对用户的开发支持显然很欠缺。FOP的开发小组也意识到了这个问题，他们允诺在将来会建立一个专门的Web站点以及丰富它的文档。如果现在就想使用更方便的产品的话，你也可以考虑一些商用产品，如RenderX和X2P。 
<br/>
<br/><a href="http://info.hustonline.net/info/document/doc.aspx?ID=467">http://info.hustonline.net/info/document/doc.aspx?ID=467</a> 
<br/>
<br/>http://www-900.ibm.com/developerWorks/cn/xml/tips/x-tippgbk/index.shtml
<br/>
<br/>
<br/><a href="http://www.hyfsoft.com.cn/news/news_egov2.htm">http://www.hyfsoft.com.cn/news/news_egov2.htm</a><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/107375.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43019/" target="_blank">[新闻]春天还是泡沫？ 社交网站遭遇“过剩危机”</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Java打印服务API</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/22/107315.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Tue, 22 Feb 2005 02:11:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/22/107315.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/107315.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/22/107315.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/107315.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/107315.html</trackback:ping><description><![CDATA[<a href="http://www.yesky.com/SoftChannel/72342371961929728/20030919/1730057.shtml">http://www.yesky.com/SoftChannel/72342371961929728/20030919/1730057.shtml</a><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/107315.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43019/" target="_blank">[新闻]春天还是泡沫？ 社交网站遭遇“过剩危机”</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>用 Preferences API 存储对象</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/20/106442.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Sun, 20 Feb 2005 08:28:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/20/106442.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/106442.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/20/106442.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/106442.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/106442.html</trackback:ping><description><![CDATA[<a href="http://www.yesky.com/SoftChannel/72342371961929728/20031015/1736117.shtml">http://www.yesky.com/SoftChannel/72342371961929728/20031015/1736117.shtml</a>
<br/><a href="http://www.matrix.org.cn/forum_view.asp?forum_id=1&amp;view_id=16363">http://www.matrix.org.cn/forum_view.asp?forum_id=1&amp;view_id=16363</a>
<br/>
<table class="tf" width="98%" border="0">
   <tbody>
       <tr>
           <td height="30">&#160;<font class="red_3"><b>[转帖]用&#160;Preferences&#160;API&#160;存储对象</b></font>
           </td>
       </tr>
       <tr>
           <td class="bw"><font class="htd">Preferences&#160;API，一种在&#160;JDK&#160;1.4&#160;中引入的轻型的、跨平台的持久性&#160;API，是为存储少量数据(字符串、简单字节数组等)而设计的，它不是为了要成为传统数据库的一个接口。不过，如果您的数据可以表示为一个简单的对象，那么它可以成为一个高效的存储设备。本文介绍了这个&#160;API，解释了对象是如何存储的，并展示了所进行的过程，提供了完成这些工作的代码库。
<br/>Preferences&#160;API&#160;是轻型的、跨平台的持久性&#160;API，它是在&#160;JDK&#160;1.4中引入的。它不是为了为传统数据库引擎提供一个接口，而是用恰当的、操作系统特定的后端以实现真正的持久性。这个&#160;API&#160;是用来存储少量数据的。事实上，它的名字本身就表明它通常用于存储用户特定的设置或者首选项，如字体大小或者窗口布局(当然，您可以在其中存储任何您想要存储的内容)。
<br/>
<br/>Preferences&#160;API&#160;设计为存储字符串、数字、布尔值、简单字节数组等。在本文中，我们将为您展示如何用&#160;Preferences&#160;API&#160;存储对象，并提供了一个为您处理细节的工作库。如果您的数据可以容易地表示为简单对象而不是像字符串和数字这种分离的值时，它会很有用。
<br/>
<br/>我们首先对该&#160;API&#160;作一简短讨论，包括一些使用它的简单例子，然后详细讨论如何使用这个&#160;API&#160;存储对象，并给出为我们完成这项工作的代码。我们还展示了一些使用这个&#160;API&#160;的例子。
<br/>
<br/>为什么设计&#160;Preferences&#160;API?
<br/>如果说&#160;Preferences&#160;API&#160;主要是为让&#160;Java&#160;程序访问&#160;Microsoft&#160;Windows&#160;注册表而创建的，一定会让人感到意外。为什么我要这么说呢？这个&#160;API&#160;的设计类似于&#160;Windows&#160;注册表，本文前三段中的大部分说明也同样适用于注册表。
<br/>
<br/>不过，Preferences&#160;API&#160;就像所有&#160;Java&#160;语言一样，是以跨平台为目的的，所以它在非&#160;Windows&#160;系统上至少可以工作得一样好(当然，本文中的代码是跨平台的)。
<br/>
<br/>Preferences&#160;API&#160;规范没有规定如何实现这个&#160;API，只规定了它必须做什么。Java&#160;运行时环境(Java&#160;Runtime&#160;Environment&#160;JRE)的每一个实现对这个&#160;API&#160;都可以有不同的实现。许多非注册表的实现将&#160;API&#160;数据存储在一个&#160;XML&#160;格式的文件中，这个文件也许是在用户的主目录中或者在一个共享目录中。
<br/>
<br/>与&#160;Windows&#160;注册表一样，Preferences&#160;API&#160;使用层次树结构来存储数据。起始点是一个&#160;root&#160;node&#160;(根节点是树的根基，所有其他节点都是这个节点的后代)。节点可以包含命名的值以及其他节点。不同的程序将它们的数据存储在树的不同位置上，所以它们不会彼此冲突。正如我们将要看到的，Preferences&#160;API&#160;采用了特殊的方法帮助防止这种冲突。
<br/>
<br/>我们将首先简单看一下&#160;Preferences&#160;API&#160;是如何工作的以及如何使用它。
<br/>
<br/>使用&#160;Preferences
<br/>理解&#160;Preferences&#160;API&#160;的最好方法是使用它。需要做的第一件事是访问根节点：
<br/>
<br/>
<br/>Preferences&#160;root&#160;=&#160;Preferences.userRoot();
<br/>
<br/>&#160;
<br/>
<br/>这一行代码返回数据树的&#160;user&#160;root。前面我们说系统中的所有数据都存储在一个树中。不过，这并不完全正确&#160;--&#160;事实上，有两个数据树&#160;--&#160;用户树和系统树。这两个树的行为完全相同，但是它们有不同的目的。系统树用于存储所用户都可以使用的数据，而用户树对于每一个用户是不同的。
<br/>
<br/>这两个树天生就有不同的目的。您要将字体首选项存储在用户树中，因为这是用户特定的内容。另一方面，您要将程序位置存储在系统树中，因为位置对于所有用户是相同的，并且所有用户都可能用到它。
<br/>
<br/>小型程序会使用系统树或者用户树，但是不会同时使用这两者。大型应用程序可能同时使用这两种树。在本文中，我们将只针对用户树，要记住用户和系统树的行为是一样的。
<br/>
<br/>现在让我们看一下如何用&#160;Preferences&#160;API&#160;读取和写入简单的值。
<br/>
<br/>获得一个值
<br/>当您得到根节点后，就用它读取和写入值。下面是如何写入一个字体大小：
<br/>
<br/>
<br/>root.putInt(&#160;&quot;fontsize&quot;,&#160;10&#160;);
<br/>
<br/>&#160;
<br/>
<br/>下面是在这之后将它读出来的方法：
<br/>
<br/>
<br/>int&#160;fontSize&#160;=&#160;prefs.getInt(&#160;&quot;fontsize&quot;,&#160;12&#160;);
<br/>
<br/>&#160;
<br/>
<br/>注意&#160;getInt()&#160;需要一个默认值&#160;--&#160;在这里是12。
<br/>
<br/>当然，您可以读取和写入整数之外的值。可以读取和写入许多基本&#160;Java&#160;类型。还可以将节点存储在其他节点中，如这个例子所示：
<br/>
<br/>
<br/>Preferences&#160;child&#160;=&#160;parent.node(&#160;&quot;child&quot;&#160;);
<br/>
<br/>&#160;
<br/>
<br/>这就是&#160;Preferences&#160;API&#160;的全部内容&#160;--&#160;剩下的就是细节使用了，我们将在下一节讨论其中一个细节。
<br/>
<br/>获得一个包的节点
<br/>不难想像两个不同的程序员可能希望存储不同的字体大小，如果他们决定以同一个名字&#8220;font&#160;size&#8221;存储他们的值，那么我们就有问题了。一个程序的首选项会影响另一个程序。
<br/>
<br/>解决方法是将内容存储在包特定的位置上，像这样：
<br/>
<br/>Preferences&#160;ourRoot&#160;=&#160;Preferences.userNodeForPackage(&#160;getClass()&#160;);
<br/>&#160;
<br/>
<br/>userNodeForPackage()&#160;方法取一个&#160;Class&#160;对象并返回这个类特定的节点。这样，每一个应用程序&#160;--&#160;假定它是在其自己的包中&#160;--&#160;都会有自己的首选项节点。
<br/>
<br/>对于&#160;Preferences&#160;API&#160;的工作方式有了很好的了解后，我们还需要知道如何扩展它以便对对象进行处理。
<br/>
<br/>存储对象
<br/>这就是我们希望将对象写入&#160;Preferences&#160;树的理想方法：
<br/>
<br/>清单&#160;1.&#160;将对象写入&#160;Preferences&#160;树的理想方法
<br/>
<br/>Font&#160;font&#160;=&#160;new&#160;Font(&#160;...&#160;);
<br/>Preferences&#160;prefs&#160;=&#160;Preferences.userNodeForPackage(&#160;getClass()&#160;);
<br/>prefs.putObject(&#160;&quot;font&quot;,&#160;font&#160;);
<br/>
<br/>&#160;
<br/>
<br/>不过,不幸的是，Preferences&#160;对象没有&#160;putObject()&#160;和&#160;getObject()&#160;方法。但是我们会尽量做到接近这一点。我们将在一个名为&#160;PrefObj&#160;的类中实现这些方法。以下是我们的做法：
<br/>
<br/>清单&#160;2.&#160;实现&#160;putObject()&#160;和&#160;getObject()
<br/>
<br/>Font&#160;font&#160;=&#160;new&#160;Font(&#160;...&#160;);
<br/>Preferences&#160;prefs&#160;=&#160;Preferences.userNodeForPackage(&#160;getClass()&#160;);
<br/>PrefObj.putObject(&#160;prefs,&#160;&quot;font&quot;,&#160;font&#160;);
<br/>
<br/>&#160;
<br/>
<br/>我们已经尽量做到在&#160;Preferences&#160;类中得到一个添加方法。
<br/>
<br/>下一节，我们将看一看&#160;getObject()&#160;和&#160;putObject()&#160;是如何实现的。
<br/>
<br/>将对象转换为字节数组
<br/>我们在这里使用的技术用到了两个技巧。第一个技巧是将对象转变为一个字节数组。这样做的原因很简单：尽管&#160;Preferences&#160;对象不处理对象，但是它可以处理字节数组。
<br/>
<br/>幸运的是，我们不需要从头开始&#160;--&#160;它已经建立在&#160;Java&#160;语言中了。有几种方式将对象转换为字节数组，下面展示了我们在&#160;PrefObj&#160;类中是如何做的：
<br/>
<br/>清单&#160;3.&#160;将对象转换为字节数组
<br/>
<br/>static&#160;private&#160;byte[]&#160;object2Bytes(&#160;Object&#160;o&#160;)&#160;throws&#160;IOException&#160;{
<br/>&#160;&#160;ByteArrayOutputStream&#160;baos&#160;=&#160;new&#160;ByteArrayOutputStream();
<br/>&#160;&#160;ObjectOutputStream&#160;oos&#160;=&#160;new&#160;ObjectOutputStream(&#160;baos&#160;);
<br/>&#160;&#160;oos.writeObject(&#160;o&#160;);
<br/>&#160;&#160;return&#160;baos.toByteArray();
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>这里的关键是&#160;ObjectOutputStream&#160;类&#160;--&#160;它是实际完成将对象转换为字节流这个魔术的类。通过用&#160;ObjectOutputStream&#160;包住&#160;ByteArrayOutputStream，我们就将字节流转换为字节数组。
<br/>
<br/>还有一种使用其他方式的方法：
<br/>
<br/>清单&#160;4.&#160;将字节数组转换为对象
<br/>
<br/>static&#160;private&#160;Object&#160;bytes2Object(&#160;byte&#160;raw[]&#160;)
<br/>&#160;&#160;&#160;&#160;throws&#160;IOException,&#160;ClassNotFoundException&#160;{
<br/>&#160;&#160;ByteArrayInputStream&#160;bais&#160;=&#160;new&#160;ByteArrayInputStream(&#160;raw&#160;);
<br/>&#160;&#160;ObjectInputStream&#160;ois&#160;=&#160;new&#160;ObjectInputStream(&#160;bais&#160;);
<br/>&#160;&#160;Object&#160;o&#160;=&#160;ois.readObject();
<br/>&#160;&#160;return&#160;o;
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>一定要记&#160;ObjectOutputStream&#160;只处理实现了&#160;java.io.Serializable&#160;接口的对象。幸运的是，这包括了几乎所有核心&#160;Java&#160;库中的对象以及您的程序中所有声明为实现&#160;Serializable&#160;的对象。
<br/>
<br/>正如我在前面提到的，Preferences&#160;API&#160;的确可以对字节数组进行处理。不过，我们在这里构造的字节数组并不是很正确，我们将在下一节看到这一点。
<br/>
<br/>将对象拆分为片段
<br/>Preferences&#160;API&#160;对可以存储在它里面的数据大小有限制。具体就是字符串限制为&#160;MAX_value_LENGTH&#160;字符。字节数组限制为&#160;MAX_value_LENGTH&#160;长度&#160;75%，因为字节数组是通过编码为字符串存储的。
<br/>
<br/>另一方面，一个对象可以为任意大小，所以我们需要将它分为几部分。当然，最容易的方法是首先将它转换为一个字节数组，然后将字节数组拆开。下面是拆开字节数组的代码，它也来自于&#160;PrefObj：
<br/>
<br/>清单&#160;5.&#160;将字节数组拆分为可消化的大小
<br/>
<br/>static&#160;private&#160;byte[][]&#160;breakIntoPieces(&#160;byte&#160;raw[]&#160;)&#160;{
<br/>&#160;&#160;int&#160;numPieces&#160;=&#160;(raw.length&#160;+&#160;pieceLength&#160;-&#160;1)&#160;/&#160;pieceLength;
<br/>&#160;&#160;byte&#160;pieces[][]&#160;=&#160;new&#160;byte[numPieces][];
<br/>&#160;&#160;for&#160;(int&#160;i=0;&#160;i&lt;numPieces;&#160;++i)&#160;{
<br/>&#160;&#160;&#160;&#160;int&#160;startByte&#160;=&#160;i&#160;*&#160;pieceLength;
<br/>&#160;&#160;&#160;&#160;int&#160;endByte&#160;=&#160;startByte&#160;+&#160;pieceLength;
<br/>&#160;&#160;&#160;&#160;if&#160;(endByte&#160;&gt;&#160;raw.length)&#160;endByte&#160;=&#160;raw.length;
<br/>&#160;&#160;&#160;&#160;int&#160;length&#160;=&#160;endByte&#160;-&#160;startByte;
<br/>&#160;&#160;&#160;&#160;pieces[i]&#160;=&#160;new&#160;byte[length];
<br/>&#160;&#160;&#160;&#160;System.arraycopy(&#160;raw,&#160;startByte,&#160;pieces[i],&#160;0,&#160;length&#160;);
<br/>&#160;&#160;}
<br/>&#160;&#160;return&#160;pieces;
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>这里没有什么复杂的内容&#160;--&#160;我们只是创建一个数组的数组，每一个长度为最大&#160;pieceLength的字节长度(pieceLength&#160;是&#160;MAX_value_LENGTH&#160;的3/4)。相应地，有另一种方法将各个部分再合并到一起：
<br/>
<br/>清单&#160;6.&#160;将片段重新组装为完整的字节数组
<br/>
<br/>static&#160;private&#160;byte[]&#160;combinePieces(&#160;byte&#160;pieces[][]&#160;)&#160;{
<br/>&#160;&#160;int&#160;length&#160;=&#160;0;
<br/>&#160;&#160;for&#160;(int&#160;i=0;&#160;i&lt;pieces.length;&#160;++i)&#160;{
<br/>&#160;&#160;&#160;&#160;length&#160;+=&#160;pieces[i].length;
<br/>&#160;&#160;}
<br/>&#160;&#160;byte&#160;raw[]&#160;=&#160;new&#160;byte[length];
<br/>&#160;&#160;int&#160;cursor&#160;=&#160;0;
<br/>&#160;&#160;for&#160;(int&#160;i=0;&#160;i&gt;pieces.length;&#160;++i)&#160;{
<br/>&#160;&#160;&#160;&#160;System.arraycopy(&#160;pieces[i],&#160;0,&#160;raw,&#160;cursor,&#160;pieces[i].length&#160;);
<br/>&#160;&#160;&#160;&#160;cursor&#160;+=&#160;pieces[i].length;
<br/>&#160;&#160;}
<br/>&#160;&#160;return&#160;raw;
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>这个例程检查所有片段的总长度并创建一个具有这种长度的新数组。然后将片段一个一个地拷贝进去。
<br/>
<br/>读取和写入片段
<br/>这里我们使用第二个技巧&#160;--&#160;将值转换为节点。一般来说，当我们用&#160;Preferences&#160;API&#160;存储值时，我们将它放到首选项数据树中一个节点的&#160;slot&#160;中。
<br/>
<br/>但是我们不能在这里真的这样做。即使一个对象只有一个值，我们也要将它转换为一组固定长度的字节数组。如果我们只有一个字节数组，写入数据树中的&#160;slot&#160;会很容易，因为&#160;Preferences&#160;API&#160;直接支持字节数组。但是这行不通，因为我们有多个数组。
<br/>
<br/>技巧是为每一个对象分配一个节点。让我们弄清楚它的意义。
<br/>
<br/>通常，将值存储在节点的多个&#160;slot&#160;的其中之一。但是我们准备为每一个对象创建一个节点，&#160;并将字节数组存储到该节点的&#160;slot&#160;中。让我们说的更具体一些。如果可以，我们会将一个对象存储到单个&#160;slot&#160;中：
<br/>
<br/>清单&#160;7.&#160;将一个对象存储到单个&#160;slot&#160;中
<br/>
<br/>Preferences&#160;parent&#160;=&#160;....;
<br/>parent.putObject(&#160;&quot;child&quot;,&#160;object&#160;);
<br/>
<br/>&#160;
<br/>
<br/>但是我们不能这么做，因为&#160;Preferences&#160;没有&#160;putObject()&#160;方法。相反，我们创建一个节点并将字节数组存储到其中，如下所示：
<br/>
<br/>清单&#160;8.&#160;将字节数组存储到一个节点中
<br/>
<br/>Preferences&#160;parent&#160;=&#160;....;
<br/>Preferences&#160;child&#160;=&#160;parent.node(&#160;&quot;child&quot;&#160;);
<br/>for&#160;(int&#160;i=0;&#160;i&lt;pieces.length;&#160;++i)&#160;{
<br/>&#160;&#160;child.putByteArray(&#160;&quot;&quot;+i,&#160;pieces[i]&#160;);
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>这样，不是将一个值存储到一个称为&#8220;child&#8221;的&#160;slot&#160;中，我们将几个值存储到一个称为&#160;&#8220;child&#8221;的节点中。这些值是用数字键&#160;--&#160;&#8220;0&#8221;、&#8220;1&#8221;、&#8220;2&#8221;等存储的。
<br/>
<br/>使用数字键可以使后面读取片段时更容易：
<br/>
<br/>清单&#160;9.&#160;读取容易读的片段
<br/>
<br/>Preferences&#160;parent&#160;=&#160;....;
<br/>Preferences&#160;child&#160;=&#160;parent.node(&#160;&quot;child&quot;&#160;);
<br/>for&#160;(int&#160;i=0;&#160;i&lt;numPieces;&#160;++i)&#160;{
<br/>&#160;&#160;pieces[i]&#160;=&#160;child.getByteArray(&#160;&quot;&quot;+i,&#160;null&#160;);
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>在下一节，我们将看一下结合所有这些步骤的例程。
<br/>
<br/>将所有内容合到一起
<br/>PrefObjs&#160;有一个名为&#160;putObject()&#160;的静态方法，它调用在前面清单&#160;3、5&#160;和&#160;8&#160;中描述的方法。其内容如下：
<br/>
<br/>清单&#160;10.&#160;方法&#160;putObject()&#160;使用其他方法来写入片段
<br/>
<br/>static&#160;public&#160;void&#160;putObject(&#160;Preferences&#160;prefs,&#160;String&#160;key,&#160;Object&#160;o&#160;)
<br/>&#160;&#160;&#160;&#160;throws&#160;IOException,&#160;BackingStoreException,&#160;ClassNotFoundException&#160;{
<br/>&#160;&#160;byte&#160;raw[]&#160;=&#160;object2Bytes(&#160;o&#160;);
<br/>&#160;&#160;byte&#160;pieces[][]&#160;=&#160;breakIntoPieces(&#160;raw&#160;);
<br/>&#160;&#160;writePieces(&#160;prefs,&#160;key,&#160;pieces&#160;);
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>方法&#160;putObject()&#160;将整个过程分为三步，分别嵌入我们在前面讨论过的三个方法。它将对象转换为字节数组(清单&#160;3)、将数组分解为更小的数组(清单&#160;5)、然后将片段写入&#160;Preferences&#160;API。
<br/>
<br/>有一个用于读取的类似方法：
<br/>
<br/>清单&#160;11.&#160;方法&#160;getObject()&#160;对写入片段做同样的事情
<br/>
<br/>static&#160;public&#160;Object&#160;getObject(&#160;Preferences&#160;prefs,&#160;String&#160;key&#160;)
<br/>&#160;&#160;&#160;&#160;throws&#160;IOException,&#160;BackingStoreException,&#160;ClassNotFoundException&#160;{
<br/>&#160;&#160;byte&#160;pieces[][]&#160;=&#160;readPieces(&#160;prefs,&#160;key&#160;);
<br/>&#160;&#160;byte&#160;raw[]&#160;=&#160;combinePieces(&#160;pieces&#160;);
<br/>&#160;&#160;Object&#160;o&#160;=&#160;bytes2Object(&#160;raw&#160;);
<br/>&#160;&#160;return&#160;o;
<br/>}
<br/>
<br/>&#160;
<br/>
<br/>这个方法从&#160;Preferences&#160;API&#160;中读取片段，并将它们结合为单个字节数组，然后将它转换为对象。
<br/>
<br/>存储信息
<br/>正如您所看到的，这是一种使用&#160;Preferences&#160;API&#160;所具有的功能的简洁方式，实现了它本来不具备的功能。这是一种扩展现有库的好方法。理论上，您可以改变库或者创建子类，但是这样有可能会干扰其他使用&#160;Preferences&#160;API&#160;的程序。而使用这种方式，您可以保持原来的&#160;API&#160;不变，同时以一种干净、有用的方式扩展它。
<br/></font>
           </td>
       </tr>
   </tbody>
</table><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/106442.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43018/" target="_blank">[新闻]中国软件外包产业今年产值将超过40亿美元</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>hibernate and spring links</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/19/105904.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Sat, 19 Feb 2005 00:37:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/19/105904.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/105904.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/19/105904.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/105904.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/105904.html</trackback:ping><description><![CDATA[<p><a href="http://blog.itpub.net/post/329/1756">http://blog.itpub.net/post/329/1756</a> 
<br/>
<br/><a href="http://blog.itpub.net/category/11/76">http://blog.itpub.net/category/11/76</a> 
<br/>
<br/><a href="http://domaindrivendesign.org/book/">http://domaindrivendesign.org/book/</a> 
<br/>
<br/><a href="http://rabbit8.blogchina.com/">http://rabbit8.blogchina.com/</a> 
</p>
<p></p>
<p>http://ckny.eatj.com/wiki/jsp/Wiki?Spring 
<br/>
<br/>hibernate 缓存相关:
<br/><a href="http://forum.javaeye.com/viewtopic.php?t=6593&amp;postdays=0&amp;postorder=asc&amp;start=0">http://forum.javaeye.com/viewtopic.php?t=6593&amp;postdays=0&amp;postorder=asc&amp;start=0</a>
<br/>
<br/><A href="http://www.cnblogs.com/na57/archive/2005/01/30/99517.html">http://www.cnblogs.com/na57/archive/2005/01/30/99517.html</a>
<br/>
<br/>
</p><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/105904.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43017/" target="_blank">[新闻]Facebook托管照片数已超100亿张 既喜又忧</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>JavaScript的Prototype实现</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101161.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Wed, 02 Feb 2005 14:56:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101161.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/101161.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101161.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/101161.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/101161.html</trackback:ping><description><![CDATA[<p align="center"><strong><font size="6">JavaScript的Prototype实现</font></strong>
</p>
<p align="center"><font size="2">作者：Jeff.Yan(阎宏),BlueSwing.Liu(刘如鸿）
   <div>
<br/><strong>模式：</strong>
   </div></font>
</p>
<div><font size="2">&#160;&#160;&#160; Prototype(原始模型模式或者原型模式）</font>
</div>
<div><font size="2"><strong>定义：</strong></font>
</div>
<div><font size="2">&#160;&#160;&#160; 通过给出一个原型对象来指明所要创建的对象的类型，然后用这个原型对象的方法创建出更多同类型的对象，原始模型模式属于对象的创建模式</font>
</div>
<div><font size="2"></font>&#160;
</div>
<div><font size="2"><strong>JavaScript实现：</strong></font>
</div>
<div><font size="2">&#160;&#160;&#160; 在Java语言中对象都继承自java.lang.Object，而java.lang.Object就提供了Clone的方法，只要实现接口Cloneable，即表示支持Clone，否则抛出异常。在这点JavaScript是非常接近的，所有的对象都是从Object继承，不过Object并不支持Clone的方法，但是我们可以通过自己对于JavaScript通过expanddo的形式实现Clone方法，这样日后所有的对象创建都实现了Clone方法。</font>
</div>
<div><font size="2"></font>&#160;
</div>
<div><font size="2">&#160;&#160;&#160; 因为JavaScript本身没有提供Clone的方法，同时对于对象的赋值如var a=new Object();var b=a，这样的代码a,b是指向同一对象的，要创建一个对象必须通过<strong><font color="#0000ff">new</font></strong> 这个关键字来实现，因此在Clone的实现过程，我内部定义了一个构造子(constructor)CloneModel，同时指定其父对象为要进行Clone活动本身的对象，因此使用了<strong><font color="#0000ff">this</font></strong>关键字，在我们定义的构造子CloneModel的基础上我们创建一个一个对象，因为构造子内部没有任何代码，新创建的对象实际上说所有的实现都在父对象中，也就是我们需要进行Clone的对象。到目前为止，我们已经创建了一个需要复制的对象，但是所有的值都是指向父对象的。</font>
</div>
<div><font size="2"></font>&#160;
</div>
<div><font size="2">&#160;&#160;&#160; 在 JavaScript的面向对象方式中 ，我们曾经讨论过，如果没有覆盖父对象的值，那么这个时候是直接指向父对象的，在Prototype Pattern是要求Clone之后的对象的内部值是不应该相关的，而只要赋值一次，objClone的值都会在自己的内存空间里头，而不是还指向父对象。基于如此的考虑，<font face="Courier New">objClone[v]=objClone[v];语句就是实现将父对象的值通过覆盖的方式拷贝到自己的内存来。（<font color="#ff0000">这里提及的内存应该是逻辑意义上的</font>)</font></font>
</div>
<div><font size="2"><font face="Courier New"></font></font>&#160;
</div>
<div><font size="2">&#160;&#160;&#160; <strong>深复制的实现</strong></font>
</div>
<div><font size="2">&#160;&#160;&#160; 在完成上述工作之后，只是实现了浅复制，对象方面依然是指向对象的引用，这个时候可以通过调用指向对象的Clone方法得到cloned对象的属性对象（因为不知道如何说了）。<font face="Courier New">objClone[v]=objClone[v].Clone(); 这句代码就是完成如此的功能。</font></font>
</div>
<div><font size="2">
<br/><strong><font size="4">Clone方法的实现</font></strong></font>
</div>
<div>
   <div style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BACKGROUND: #e6e6e6; BORDER-LEFT: black 1px solid; WIDTH: 100%; BORDER-BOTTOM: black 1px solid; HEIGHT: 20px"><font face="宋体"><pre><code><font face="Courier New"><font size="2"><font color="#008000">//////////////////////////////////////////////////////////////////////
//为Object添加Clone的方法，因为所有的对象的顶级对象都是Object
//因此所有用户自定义对象都实现了Clone的方法
//////////////////////////////////////////////////////////////////////
</font>Object.<font color="#0000ff"><b>prototype</b></font>.Clone=<font color="#0000ff"><b>function</b></font>(){
 <font color="#0000ff"><b>function </b></font>CloneModel(){
  
 }
 CloneModel.<font color="#0000ff"><b>prototype</b></font>=<font color="#0000ff"><b>this</b></font>;
 <font color="#0000ff"><b>var </b></font>objClone=<font color="#0000ff"><b>new  </b></font>CloneModel();
 
 <font color="#0000ff"><b>var </b></font>strMsg=&quot;&quot;;
 <font color="#0000ff"><b>for</b></font>( v <font color="#0000ff"><b>in </b></font>objClone){ 
  <font color="#0000ff"><b>switch </b></font>(<font color="#0000ff"><b>typeof </b></font>objClone[v]){
   <font color="#0000ff"><b>case </b></font>&quot;function&quot;:
    </font><font size="2"><font color="#008000">//如果是方法，不需要进行clone
</font>    <font color="#0000ff"><b>break</b></font>;
   <font color="#0000ff"><b>case </b></font>&quot;object&quot;:
   </font><font size="2"><font color="#008000">///////////////////////////////////////////////////////////////////////
</font>   </font><font size="2"><font color="#008000">//如果是对象，采用Clone重新得到，这样做的目的在于能够进行深度Clone
</font>   </font><font size="2"><font color="#008000">//因为JavaScript是一个Object Based的语言，不然内部对象是指向原来的引用
</font>   </font><font size="2"><font color="#008000">///////////////////////////////////////////////////////////////////////
</font>    objClone[v]=objClone[v].Clone();
    <font color="#0000ff"><b>break</b></font>;
   <font color="#0000ff"><b>default</b></font>:
   </font><font size="2"><font color="#008000">///////////////////////////////////////////////////////////////////////
</font>   </font><font size="2"><font color="#008000">//其余数据类型情况下全部重新赋值
</font>   </font><font size="2"><font color="#008000">//这样做的目的就是保证数值在内存中的存放是在新对象的空间中
</font>   </font><font size="2"><font color="#008000">//而不仅仅指向Parent Object的一个refrence
</font>   </font><font size="2"><font color="#008000">///////////////////////////////////////////////////////////////////////
</font>    objClone[v]=objClone[v];
  }   
 }
 <font color="#0000ff"><b>return </b></font>objClone;
}
</font></font></code></pre></font>
   </div>
</div>
<div><font size="2"></font>&#160;
</div>
<div><font size="4"><strong>对象类的定义</strong></font>
</div>
<div>
<br/>
</div>
<div>
   <div style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BACKGROUND: #e6e6e6; BORDER-LEFT: black 1px solid; WIDTH: 100%; BORDER-BOTTOM: black 1px solid; HEIGHT: 20px"><font face="宋体"><pre><code><font face="Courier New"><font size="2"><font color="#0000ff"><b>function </b></font>BookInfo(vCaption){
 <font color="#0000ff"><b>this</b></font>.Caption=vCaption; 
 <font color="#0000ff"><b>var </b></font>curPage=0;
 <font color="#0000ff"><b>this</b></font>.setPage=<font color="#0000ff"><b>function</b></font>(vData){
  curPage=vData;
 }
 <font color="#0000ff"><b>this</b></font>.getPage=<font color="#0000ff"><b>function</b></font>(){
  <font color="#0000ff"><b>return </b></font>curPage;
 } 
}
</font></font></code></pre></font>
   </div>
</div>
<div><font size="2"></font>&#160;
</div>
<div><strong><font size="4">测试代码</font></strong>
</div>
<div><font size="2"></font>
<br/>
</div>
<div>
   <div style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BACKGROUND: #e6e6e6; BORDER-LEFT: black 1px solid; WIDTH: 100%; BORDER-BOTTOM: black 1px solid; HEIGHT: 20px"><font face="宋体"><pre><code><font face="Courier New"><font size="2"><font color="#008000">//////////////////////////////////
//test BookInfo &#39;s clone method
//
//////////////////////////////////
</font><font color="#0000ff"><b>function </b></font>test(){
 <font color="#0000ff"><b>var </b></font>objTest=<font color="#0000ff"><b>new </b></font>BookInfo(&quot;JavaScript Prototype Pattern&quot;);
 objTest.setPage(1000);
 
 objTest.Author=&quot;Ruhong.Liu&quot;; </font><font size="2"><font color="#008000">//object expanddo
</font> 
 ShowObject(objTest,&quot;原始对象&quot;);
 </font><font size="2"><font color="#008000">//Clone Object from objTest
</font> <font color="#0000ff"><b>var </b></font>objCloned=objTest.Clone();
 ShowObject(objCloned,&quot;Clone之后的对象&quot;); 
 </font><font size="2"><font color="#008000">//if you changed the objTest&#39;s caption
</font> </font><font size="2"><font color="#008000">//you can find objCloned&#39;s caption has be changed
</font> objTest.Caption=&quot;Changed Base Object&quot;;
 </font><font size="2"><font color="#008000">//show message
</font> ShowObject(objTest,&quot;修改Caption之后的原始对象&quot;);
 ShowObject(objCloned,&quot;修改Caption之后的clone对象&quot;);
 
 
</font><font size="2"><font color="#008000">/*
 //----------这段代码可以不工作------------------------//
 //now you can change objCloned&#39;s caption
 objCloned.Caption=&quot;hello,Jeff.Yan&quot;;
 //show message
 ShowObject(objTest,&quot;Clone对象Caption修改之后的原始对象&quot;);
 ShowObject(objCloned,&quot;Clone对象Caption修改以后&quot;);
*/</font> 
}
<font color="#0000ff"><b>function </b></font>ShowObject(o,vCaption){
 <font color="#0000ff"><b>var </b></font>strMsg=vCaption +&quot;\n&quot;;
 strMsg+=&quot;CurrentPage:        &quot; + o.getPage() +&quot;\n&quot;;
 strMsg+=&quot;Caption:         &quot; + o.Caption +&quot;\n&quot;;
 strMsg+=&quot;Expanddo Property Author:       &quot; + o.Author;
 alert(strMsg);
}</font></font>
</code></pre></font>
   </div>
</div>
<div><hr />
</div>
<div><font size="2"></font>&#160;
</div>
<div><font size="2"></font>&#160;
</div>
<div><font size="2">结束语：</font>
</div>
<div><font size="2">&#160;&#160;&#160; 按照我目前的理解和测试，我觉得prototype关键字不是prototype模式的实现，这点通过parent object可以得到验证。</font>
</div>
<br/>
<div style="FONT-SIZE: 14px; LINE-HEIGHT: 25px"><strong>作者Blog：</strong><a id="ArticleContent1_ArticleContent1_AuthorBlogLink" href="http://blog.csdn.net/liuruhong/" target="_blank"><font color="#0000ff">http://blog.csdn.net/liuruhong/</font></a>
</div>
<div style="FONT-SIZE: 14px; COLOR: #900; LINE-HEIGHT: 25px"><strong>相关文章</strong>
</div>
<table id="ArticleContent1_ArticleContent1_RelatedArticles" cellSpacing="0" border="0" style="BORDER-COLLAPSE: collapse">
   <tbody>
       <tr>
           <td><a href="article/57/57419.shtm"><font color="#0000ff">战争与和平——纵观浏览器发展二三语</font></a> 
           </td>
       </tr>
       <tr>
           <td><a href="article/56/56168.shtm"><font color="#0000ff">越过浏览器开发的鼎盛时期，迎接RIA时代的到来</font></a> 
           </td>
       </tr>
       <tr>
           <td><a href="article/49/49238.shtm"><font color="#0000ff">Longhorn时代，浏览器的终结？——关于Avalon和XAML</font></a> 
           </td>
       </tr>
       <tr>
           <td><a href="article/47/47560.shtm"><font color="#0000ff">C++/CLI会冲击C#吗？</font></a> 
           </td>
       </tr>
       <tr>
           <td><a href="article/41/41250.shtm"><font color="#0000ff">在较量中携手前行——写给Java 1.5和.NET 2.0</font></a> 
           </td>
       </tr>
   </tbody>
</table><a name="#Comment"></a>
<table cellPadding="0" width="100%" border="0">
   <tbody>
       <tr>
           <td>
              <table cellSpacing="0" cellPadding="0" width="100%" align="center" bgColor="#006699" border="0">
                  <tbody>
                      <tr bgColor="#006699">
                            <td id="white" align="center" width="556" bgColor="#006699"><font color="#ffffff">对该文的评论</font> 
                            </td>
                      </tr>
                  </tbody>
              </table>
              <table cellSpacing="1" cellPadding="2" width="100%" align="center" bgColor="#666666" border="0">
                  <tbody>
                      <tr>
                            <td bgColor="#cccccc" colSpan="3"><span style="COLOR: #990000"><img height="16" hspace="1" src="http://www.cnblogs.com/images/ico_pencil.gif" width="16" /> </span><span id="CommnetList1_CommnetList1_rpCommentList__ctl0_lblUserName">windseeds</span> <i>( <span id="CommnetList1_CommnetList1_rpCommentList__ctl0_lblPostTime">2004-05-09</span>)</i> 
                            </td>
                      </tr>
                      <tr>
                            <td width="532" bgColor="#ffffff" colSpan="3"><span id="CommnetList1_CommnetList1_rpCommentList__ctl0_lblContent">另外，补充一点，对于对象内部成员变量，最好不要写成var&#160;curPage，
<br/>会引起一些问题，具体什么问题我记不清了，我以前在开发中遇到过。
<br/>
<br/>用下划线来区分私有和公共是比较标准的做法，js本身的对象就是这么
<br/>做的，比如Object。也就是说
<br/>私有变量：this._curPage&#160;=&#160;0;
<br/>公共变量：this.curPange&#160;=&#160;0;
<br/></span>
                            </td>
                      </tr>
                  </tbody>
              </table>
              <table cellSpacing="1" cellPadding="2" width="100%" align="center" bgColor="#666666" border="0">
                  <tbody>
                      <tr>
                            <td bgColor="#cccccc" colSpan="3"><span style="COLOR: #990000"><img height="16" hspace="1" src="http://www.cnblogs.com/images/ico_pencil.gif" width="16" /> </span><span id="CommnetList1_CommnetList1_rpCommentList__ctl1_lblUserName">windseeds</span> <i>( <span id="CommnetList1_CommnetList1_rpCommentList__ctl1_lblPostTime">2004-05-09</span>)</i> 
                            </td>
                      </tr>
                      <tr>
                            <td width="532" bgColor="#ffffff" colSpan="3"><span id="CommnetList1_CommnetList1_rpCommentList__ctl1_lblContent">这篇文章写的艰深了一点，实际上没有这么复杂。prototype实际上就是一个对象链。</span> 
                            </td>
                      </tr>
                  </tbody>
              </table>
              <table cellSpacing="1" cellPadding="2" width="100%" align="center" bgColor="#666666" border="0">
                  <tbody>
                      <tr>
                            <td bgColor="#cccccc" colSpan="3"><span style="COLOR: #990000"><img height="16" hspace="1" src="http://www.cnblogs.com/images/ico_pencil.gif" width="16" /> </span><span id="CommnetList1_CommnetList1_rpCommentList__ctl2_lblUserName">liuruhong</span> <i>( <span id="CommnetList1_CommnetList1_rpCommentList__ctl2_lblPostTime">2004-01-01</span>)</i> 
                            </td>
                      </tr>
                      <tr>
                            <td width="532" bgColor="#ffffff" colSpan="3"><span id="CommnetList1_CommnetList1_rpCommentList__ctl2_lblContent">记得认识Jeff的时候对于这个方面我也没有兴趣，不过后来在做Web&#160;Library的时候才发现Design&#160;Pattern的功底还是可以派上用场的，虽然我也不太赞成client端的脚本太多复杂。不过复杂只是相对的，如果是在你的Application开发中，我不太建议程序员在Web&#160;上面的脚本花费太多的功夫，不过如果是希望编写一些比较通用的库文件提供给其他开发人员使用，我想设计方面的功底要求比其实现功能的功底更加重要吧。大家也应该可以看到网络上提供的脚本很多吧，如果在实现一些功能方面无法复用和可扩展，那么还是提供一些教学目的的脚本似乎更加合适一点。反过来说，Design&#160;Pattern的学习对于构件开发人员而言是一个很重要的基础，不管是windows下面的ActiveX开发，还是Open&#160;Source形式的library,对于Web&#160;UI&#160;Library开发人员而言，似乎也没有本质的区别</span> 
                            </td>
                      </tr>
                  </tbody>
              </table>
              <table cellSpacing="1" cellPadding="2" width="100%" align="center" bgColor="#666666" border="0">
                  <tbody>
                      <tr>
                            <td bgColor="#cccccc" colSpan="3"><span style="COLOR: #990000"><img height="16" hspace="1" src="http://www.cnblogs.com/images/ico_pencil.gif" width="16" /> </span><span id="CommnetList1_CommnetList1_rpCommentList__ctl3_lblUserName">leeeel</span> <i>( <span id="CommnetList1_CommnetList1_rpCommentList__ctl3_lblPostTime">2003-12-29</span>)</i> 
                            </td>
                      </tr>
                      <tr>
                            <td width="532" bgColor="#ffffff" colSpan="3"><span id="CommnetList1_CommnetList1_rpCommentList__ctl3_lblContent">一定要将JS上升到这个境界，实在是高！
<br/>问题是在客户端JS写得太长，下载数据和内存占用都太大了
<br/>JS能不能简单地应用在开发中？</span> 
                            </td>
                      </tr>
                  </tbody>
              </table>
              <table cellSpacing="1" cellPadding="2" width="100%" align="center" bgColor="#666666" border="0">
                  <tbody>
                      <tr>
                            <td bgColor="#cccccc" colSpan="3"><span style="COLOR: #990000"><img height="16" hspace="1" src="http://www.cnblogs.com/images/ico_pencil.gif" width="16" /> </span><span id="CommnetList1_CommnetList1_rpCommentList__ctl4_lblUserName">kingdomzhf</span> <i>( <span id="CommnetList1_CommnetList1_rpCommentList__ctl4_lblPostTime">2003-12-27</span>)</i> 
                            </td>
                      </tr>
                      <tr>
                            <td width="532" bgColor="#ffffff" colSpan="3"><span id="CommnetList1_CommnetList1_rpCommentList__ctl4_lblContent">是对象进一步拷贝，直到是function和primitive类型（不是对象）</span> 
                            </td>
                      </tr>
                  </tbody>
              </table>
           </td>
       </tr>
   </tbody>
</table><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/101161.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43016/" target="_blank">[新闻]华源热议：金融危机下的中国机会</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Eclipse 运行命令行参数大全 </title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101112.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Wed, 02 Feb 2005 13:27:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101112.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/101112.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101112.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/101112.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/101112.html</trackback:ping><description><![CDATA[<div class="postheader"><a name="637044"></a><a href="http://beansoft.blogchina.com/">http://beansoft.blogchina.com/</a>
<br/>
<br/>
   <p>包括英文版本和中文版本两种的说明, 特别需要值得一提的是那个 -nl 参数, 可以指定程序启动时所使用的语言. 例如:
<br/>eclipse -nl en_US
<br/>将启动英文语言, 这个特性在安装了国际化语言包以后特别有用, 可以方便的切换各个语言的版本. 注意 IBM WSAD v5.1 也支持这个功能.
<br/>
   </p><h1>运行 Eclipse</h1>
   <p>将 Eclipse 驱动程序安装（解压缩）到某个目录（例如，c:\eclipse）中之后，通过运行顶级安装目录中的 Eclipse 可执行文件来启动&quot;工作台&quot;。在 Windows 系统上，该可执行文件称为 eclipse.exe，而在 Linux 系统上称为 eclipse。<strong>注意：</strong>下列讨论描述 Windows 系统上的设置。Linux 上的设置是相似的。
   </p>
   <p>如果您没有另行指定，则平台将缺省工作区目录创建为可执行文件的兄弟目录（例如 c:\eclipse\workspace）。此工作区目录用作项目的缺省内容区，还用于保存任何必需的元数据。要进行共享安装或多工作区安装，应明确指出工作区的位置而不是使用缺省值。有两种控制工作区位置的方法：使用当前工作目录或使用 -data 命令行自变量。</p><h3>将工作区位置设置为在当前工作目录内</h3>
   <p>在此方案中，工作区位置将是当前工作目录中称为 workspace 的目录。</p>
   <p>实现此目的最容易的方法可能是使用下列步骤来创建快捷方式：</p>
   <ol start="1">
       <li>导航到 Windows 资源管理器中的 eclipse.exe 并使用右键拖动来创建 eclipse.exe 的快捷方式。 </li>
       <li>编辑快捷方式的属性，以使<strong>启动位置：</strong>字段标识工作区位置的父目录（例如，c:\users\robert）。 
       </li>
       <li>关闭属性对话框并双击快捷方式（如果提供的目录为 c:\users\robert，则工作区位置将为 c:\users\robert\workspace）。 </li>
   </ol>
   <p>当然，您也可以使用命令提示符（通过将目录切换为工作区父目录然后运行 eclipse.exe）来获得同样的效果。</p><h3>使用 -data 设置工作区的特定位置</h3>
   <p>要使用 -data 命令行自变量，只要将 -data your_workspace_location（例如，-data c:\users\robert\myworkspace）添加至快捷方式属性中的<strong>目标</strong>字段或显式地将它包括在命令行上。
   </p><h3>使用 -vm 设置 java VM</h3>
   <p>建议显式指定在运行 Eclipse 时要使用哪个 Java VM。使用 -vm 命令行自变量（例如，-vm c:\jre\bin\javaw.exe）可以实现此目的。如果不使用 -vm，则 Eclipse 将使用在 O/S 路径上找到的一个 Java VM。当安装其它产品时，它们可更改您的路径，导致在下一次启动 Eclipse 时使用另一 Java VM。</p><h2>运行 Eclipse 中的高级主题</h2>
   <p>Eclipse 可执行文件及平台本身提供了人们感兴趣的开发或调试 Eclipse 各部件的许多执行选项。运行 Eclipse 可执行文件的一般格式是：</p><blockquote><pre>eclipse [platform options] [-vmargs [Java VM arguments]]</pre></blockquote>
   <table height="543" width="90%" border="1"><strong><>Eclipse 启动参数 </></strong> 
       <tbody>
           <tr><strong><>命令 <strong>描述</strong> </></strong>  
              <td width="2%"><strong>原因</strong>
              </td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-arch</strong> architecture</pre>
              </td>
              <td width="65%">定义 Eclipse 平台在其上运行的处理器体系结构。Eclipse 平台通常使用 Java os.arch 属性的常用值来计算最佳设置。如果在此处指定该项，则这是 Eclipse 平台使用的值。此处指定的值可作为 BootLoader.getOSArch() 用于插件。示例值有：&quot;x86&quot;、&quot;sparc&quot;、&quot;PA-RISC&quot;和&quot;ppc&quot;。</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-application</strong> applicationId</pre>
              </td>
              <td width="65%">要运行的应用程序。应用程序由向 org.eclipse.core.runtime.applications 扩展点提供扩展的插件来声明。通常不需要此自变量。如果指定了此项，则该值会覆盖配置提供的值。如果不指定此项，则会运行&quot;Eclipse 工作台&quot;。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-boot</strong> bootJarURL</pre>
              </td>
              <td width="65%"><em>（建议不使用；用 -configuration 代替；支持 1.0 兼容）</em>。Eclipse 平台的引导插件代码（boot.jar）的位置，表示为 URL。如果指定此项，则会用它来为装入 Eclipse 平台引导程序类装入器的类装入器设置类路径。仅当更改 startup.jar 和 boot.jar 的相对位置时才需要它。注意，不允许使用相对 URL。 
              </td>
              <td width="2%">*1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-classloaderproperties</strong> [file]</pre>
              </td>
              <td width="65%">如果指定的话，则使用给定位置处的类装入器属性文件来激活平台类类装入器增强。文件自变量可以是文件路径或 URL。注意，不允许使用相对 URL。单击<a href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform-core-home/docs/classloader-properties/classloader_properties.html"><font color="#0000ff">此处</font></a>以获得更多详细信息。
              </td>
              <td width="2%">2.0.2</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-configuration</strong> configurationFileURL</pre>
              </td>
              <td width="65%">Eclipse 平台配置文件的位置，表示为 URL。配置文件确定 Eclipse 平台、可用插件集和主要功能部件的位置。注意，不允许使用相对 URL。当安装或更新 Eclipse 平台时配置文件被写至此位置。 </td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-consolelog</strong></pre>
              </td>
              <td width="65%">将 Eclipse 平台的错误日志镜像到用来运行 Eclipse 的控制台。与 -debug 组合时很方便使用。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-data</strong> workspacePath</pre>
              </td>
              <td width="65%">要运行 Eclipse 平台的工作区的路径。工作区位置也是项目的缺省位置。相对于从中启动 eclipse 的目录来解释相对路径。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-debug</strong> [optionsFile]</pre>
              </td>
              <td width="65%">将平台置于调试方式，并从给定位置处的文件装入调试选项（如果指定的话）。此文件指示哪些调试点可用于插件以及是否已启用它们。如果未给出文件位置，则平台在启动 eclipse 的目录中查找称为&quot;.options&quot;的文件。URL 和文件系统路径都可作为文件位置。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-dev</strong> [classpathEntries]</pre>
              </td>
              <td width="65%">将平台置于开发方式。将可选类路径条目（用逗号分隔的列表）添加至每个插件的运行时类路径。例如，当工作区包含要开发的插件时，指定 -dev bin 会为每个插件项目的名为 bin 的目录添加类路径条目，允许在其中存储最新生成的类文件。除去了冗余或不存在的类路径条目。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-endsplash</strong> params</pre>
              </td>
              <td width="65%" height="16">用于在 Eclipse 平台启动并运行时关闭闪屏的内部选项。此选项在闪屏处理链中不同的位置有不同的语法和语义。</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-feature</strong> <em>featureId</em></pre>
              </td>
              <td width="65%" height="16">主要功能部件的标识。主要功能部件为 Eclipse 的已启动实例提供了产品个性，并确定使用的产品定制信息。</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-keyring</strong> keyringFilePath</pre>
              </td>
              <td width="65%">磁盘上授权数据库（或&quot;密钥环&quot;文件）的位置。此自变量必须与 -password 选项配合使用。相对于从中启动 eclipse 的目录来解释相对路径。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-nl</strong> locale</pre>
              </td>
              <td width="65%">定义 Eclipse 平台在其上运行的语言环境的名称。Eclipse 平台通常自动计算最佳设置。如果在此处指定该项，则这是 Eclipse 平台使用的值。此处指定的值可作为 BootLoader.getNL() 用于插件。示例值有：&quot;en_US&quot;和&quot;fr_FR_EURO&quot;。</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-nolazyregistrycacheloading</strong></pre>
              </td>
              <td width="65%">取消激活装入优化的平台插件注册表高速缓存。缺省情况下，仅当需要时才从注册表高速缓存（可用时）中装入扩展的配置元素，以减少内存占用。此选项将在启动时强制完全装入注册表高速缓存。</td>
              <td width="2%">2.1</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-noregistrycache</strong></pre>
              </td>
              <td width="65%">绕过读写内部插件注册表高速缓存文件。</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-nosplash</strong></pre>
              </td>
              <td width="65%">运行平台而不显示闪屏。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-os</strong> operatingSystem</pre>
              </td>
              <td width="65%">定义 Eclipse 平台在其上运行的操作系统。Eclipse 平台通常使用 Java os.name 属性的常用值来计算最佳设置。如果在此处指定该项，则这是 Eclipse 平台使用的值。此处指定的值可作为 BootLoader.getOS() 用于插件，并用于解析插件清单文件中提及的路径中 $os$ 变量的出现。示例值有：&quot;win32&quot;、&quot;linux&quot;、&quot;hpux&quot;、&quot;solaris&quot;和&quot;aix&quot;。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-password</strong> password</pre>
              </td>
              <td width="65%">授权数据库的密码。与 -keyring 选项配合使用。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-perspective</strong> perspectiveId</pre>
              </td>
              <td width="65%">启动时要在活动工作台窗口中打开的透视图。如果没有指定该参数，则将打开关闭时活动的透视图。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-plugincustomization</strong>
	  propertiesFile</pre>
              </td>
              <td width="65%">包含插件首选项缺省设置的属性文件的位置。这些缺省设置覆盖在主要功能部件中指定的缺省设置。相对于从中启动 eclipse 的目录来解释相对路径。</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-plugins</strong> pluginsFileURL</pre>
              </td>
              <td width="65%" height="16"><em>（建议不使用；用 -configuration 代替；支持 1.0 兼容）。</em> 指定 Eclipse 平台查找插件的文件的位置，表示为 URL。该文件为属性文件格式，其中键是任意用户定义名称，值是指向 plugin.xml 文件的显式路径或指向包含插件的目录的路径的用逗号分隔的列表。注意，不允许使用相对 URL。如果指定此项，则此选项会导致创建适当的临时配置。
              </td>
              <td width="2%" height="16">*1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-refresh</strong> </pre>
              </td>
              <td width="65%" height="16">启动时执行工作区的全局刷新的选项。这将使从上次平台运行以来在文件系统中所做的任何更改一致。</td>
              <td width="2%" height="16">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-showlocation</strong> </pre>
              </td>
              <td width="65%" height="16">用于在窗口标题栏中显示工作区的位置的选项。在发行版 2.0 中，此选项仅与 -data 命令行自变量一起使用。</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-showsplash</strong> params</pre>
              </td>
              <td width="65%" height="16">用于显示闪屏（由可执行的 Eclipse 平台启动器执行）的内部选项。此选项在闪屏处理链中不同的位置有不同的语法和语义。</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-vm</strong> vmPath</pre>
              </td>
              <td width="65%">要用来运行 Eclipse 平台的&quot;Java 运行时环境&quot;（JRE）的位置。如果不指定此项，则 JRE 位于 jre（它是 Eclipse 可执行文件的兄弟目录）。相对于从中启动 eclipse 的目录来解释相对路径。</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-ws</strong> windowSystem</pre>
              </td>
              <td width="65%">定义 Eclipse 平台在其上运行的 Windows 系统。Eclipse 平台通常使用 Java os.name 属性的常用值来计算最佳设置。如果在此处指定该项，则这是 Eclipse 平台使用的值。此处指定的值可作为 BootLoader.getWS() 用于插件、用于配置 SWT 以及用于解析插件清单文件中提及的路径中 $ws$ 变量的出现。示例值有：&quot;win32&quot;、&quot;motif&quot;和&quot;gtk&quot;。</td>
              <td width="2%">1.0</td>
           </tr>
       </tbody>
   </table>
   <p>将 -vmargs 条目后面的所有自变量（但不包括 -vmargs）作为虚拟机自变量（即，在要运行的类的前面）直接传递到所指示的 Java VM。<strong>注意：</strong>如果 Eclipse 启动在 Java vm 自变量（-vmargs）之后提供的自变量（例如，-data），则 Eclipse 将不会启动并且您将接收到&quot;JVM 已终止。出口代码为 1&quot;的错误。
   </p><h2>在不同的 VM 上运行&#160;</h2><h3>在 J9 上运行 Eclipse</h3>
   <p>当在 J9 版本 1.5 上运行 Eclipse 时，建议使用以下 VM 选项： </p><blockquote><pre>eclipse.exe [eclipse arguments] -vm path_to_j9w.exe 
            -vmargs -ms:32 -mm:2048 -mo:32768 -moi:32768 -mca:32 -mco:128 -mx:2000000</pre></blockquote>
   <p>当在 J9 版本 2.0 上运行 Eclipse 时，J9W 选择的缺省自变量应为合适的选项。但是，要覆盖 Eclipse 可执行文件以内部方式自动设置的参数，必须指定 -vmargs 不带任何参数，如下所示： </p><blockquote><pre>eclipse.exe [eclipse arguments] -vm path_to_j9w.exe -vmargs</pre></blockquote>
   <p>有关进一步信息，参考 J9 VM 文档和帮助。</p><h3>在 IBM Developer Kit, Java(TM) Technology Edition VM 上运行 Eclipse</h3>
   <p>IBM Developer Kit, Java(TM) Technology Edition 1.3 Linux 的缺省 VM 设置适合进行初期研究工作，但在进行大型开发时是不够的。对于大型开发，应修改 VM 自变量以使有更多的堆可用。例如，下列设置将允许 Java 堆增大为 256MB：</p><blockquote><pre>-vmargs -Xmx256M </pre></blockquote>
   <p>&#160;
<br/><a href="http://blog.blogchina.com../hglegal2003.htm"><img height="14" alt="Copyright IBM Corporation and others 2000, 2003" src="http://blog.blogchina.comc:/DOCUME%7E1/vip/LOCALS%7E1/Temp/CodeWeb/171_FI%7E1/help/topic/ORGECL%7E1.USE/images/ngibmcpy2003_.gif" width="324" border="0" /></a>
<br/>
   </p><h1>Running Eclipse</h1>
   <p>After you install (unzip) the Eclipse driver in a directory (such as c:\eclipse), start the Workbench by running the Eclipse executable file found in the top level install directory. The executable file is called eclipse.exe on Windows systems and eclipse on Linux systems. <strong>Note:</strong> the following discussion describes setting up on Windows systems. Setup on Linux is analogous.
   </p>
   <p>If you do not specify otherwise, the platform creates a default workspace directory as a sibling of the executable (for example, c:\eclipse\workspace). This workspace directory is used as the default content area for your projects as well as for holding any required metadata. For shared or multi-workspace installs you should explicitly state the location of your workspace rather than using the default. There are two ways to control the location of your workspace: using the current working directory or using the -data command line argument.</p><h3>Setting the workspace location to be inside the current working directory</h3>
   <p>In this scenario, the workspace location will be a directory called workspace inside the current working directory.</p>
   <p>Perhaps the easiest way of doing this is to create a shortcut using the following steps:</p>
   <ol start="1">
       <li>Navigate to eclipse.exe in the Windows Explorer and using a right button drag, create a shortcut to eclipse.exe. </li>
       <li>Edit the properties of the shortcut such that the <strong>Start in:</strong> field identifies the parent directory of your workspace location (for example, c:\users\robert). 
       </li>
       <li>Close the properties dialog and double-click on the shortcut (if the provided directory was c:\users\robert, the workspace location would be c:\users\robert\workspace). </li>
   </ol>
   <p>Of course you can get the same effect using a command prompt by changing directory to your workspace parent&#39;s directory and then running eclipse.exe.</p><h3>Setting a specific location for the workspace with -data</h3>
   <p>To use the -data command line argument, simply add -data your_workspace_location (for example, -data c:\users\robert\myworkspace) to the <strong>Target</strong> field in the shortcut properties, or include it explicitly on your command line.
   </p><h3>Setting the java VM using -vm</h3>
   <p>It is recommended that you explicitly specify which Java VM to use when running Eclipse. This is achieved with the -vm command line argument (for example, -vm c:\jre\bin\javaw.exe). If you don&#39;t use -vm, Eclipse will use the first Java VM found on the O/S path. When you install other products, they may change your path, resulting in a different Java VM being used when you next launch Eclipse. </p><h2>Advanced Topics in Running Eclipse </h2>
   <p>The Eclipse executable and the platform itself offer a number of execution options of interest to people developing or debugging parts of Eclipse. The general form of running the Eclipse executable is:</p><blockquote><pre>eclipse [platform options] [-vmargs [Java VM arguments]]</pre></blockquote>
   <table height="543" width="90%" border="1"><strong><>Eclipse Startup Parameters </></strong>
       <tbody>
           <tr><strong><>Command <strong>Description</strong> </></strong>  
              <td width="2%"><strong>Since</strong>
              </td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-arch</strong> architecture</pre>
              </td>
              <td width="65%">Defines the processor architecture on which the Eclipse platform is running. The Eclipse platform ordinarily computes the optimal setting using the prevailing value of Java os.arch property. If specified here, this is the value that the Eclipse platform uses. The value specified here is available to plug-ins as BootLoader.getOSArch(). Example values: &quot;x86&quot;, &quot;sparc&quot;, &quot;PA-RISC&quot;, &quot;ppc&quot;.</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-application</strong> applicationId</pre>
              </td>
              <td width="65%">The application to run. Applications are declared by plug-ins supplying extensions to the org.eclipse.core.runtime.applications extension point. This argument is typically not needed. If specified, the value overrides the value supplied by the configuration. If not specified, the Eclipse Workbench is run.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-boot</strong> bootJarURL</pre>
              </td>
              <td width="65%"><em>(Deprecated; replaced by -configuration; supported for 1.0 compatibility)</em>. The location of the Eclipse platform&#39;s boot plug-in code (boot.jar), expressed as a URL. If specified, it is used to set the classpath for the class loader that loads the Eclipse platform bootstrap class loader. Only required when changing the relative location of startup.jar and boot.jar. Note that relative URLs are not allowed. 
              </td>
              <td width="2%">*1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-classloaderproperties</strong> [file]</pre>
              </td>
              <td width="65%">Activates platform class loader enhancements using the class loader properties file at the given location, if specified. The file argument can be either a file path or a URL. Note that relative URLs are not allowed. Click <a href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/platform-core-home/docs/classloader-properties/classloader_properties.html"><font color="#0000ff">here</font></a> for more details.
              </td>
              <td width="2%">2.0.2</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-configuration</strong> configurationFileURL</pre>
              </td>
              <td width="65%">The location for the Eclipse Platform configuration file, expressed as a URL. The configuration file determines the location of the Eclipse platform, the set of available plug-ins, and the primary feature. Note that relative URLs are not allowed. The configuration file is written to this location when the Eclipse platform is installed or updated. </td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-consolelog</strong></pre>
              </td>
              <td width="65%">Mirrors the Eclipse platform&#39;s error log to the console used to run Eclipse. Handy when combined with -debug.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-data</strong> workspacePath</pre>
              </td>
              <td width="65%">The path of the workspace on which to run the Eclipse platform. The workspace location is also the default location for projects. Relative paths are interpreted relative to the directory that Eclipse was started from.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-debug</strong> [optionsFile]</pre>
              </td>
              <td width="65%">Puts the platform in debug mode and loads the debug options from the file at the given location, if specified. This file indicates which debug points are available for a plug-in and whether or not they are enabled. If a file location is not given, the platform looks in the directory that eclipse was started from for a file called &quot;.options&quot;. Both URLs and file system paths are allowed as file locations. </td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-dev</strong> [classpathEntries]</pre>
              </td>
              <td width="65%">Puts the platform in development mode. The optional classpath entries (a comma separated list) are added to the runtime classpath of each plug-in. For example, when the workspace contains plug-ins being developed, specifying -dev bin adds a classpath entry for each plug-in project&#39;s directory named bin, allowing freshly generated class files to be found there. Redundant or non-existent classpath entries are eliminated.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-endsplash</strong> params</pre>
              </td>
              <td width="65%" height="16">Internal option for taking down the splash screen when the Eclipse platform is up and running. This option has different syntax and semantics at various points along the splash screen processing chain.</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-feature</strong> <em>featureId</em></pre>
              </td>
              <td width="65%" height="16">The ID of the primary feature. The primary feature gives the launched instance of Eclipse its product personality, and determines the product customization information used.</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-keyring</strong> keyringFilePath</pre>
              </td>
              <td width="65%">The location of the authorization database (or &quot;key ring&quot; file) on disk. This argument must be used in conjunction with the -password option. Relative paths are interpreted relative to the directory that Eclipse was started from.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-nl</strong> locale</pre>
              </td>
              <td width="65%">Defines the name of the locale on which the Eclipse platform is running. The Eclipse platform ordinarily computes the optimal setting automatically. If specified here, this is the value that the Eclipse platform uses. The value specified here is available to plug-ins as BootLoader.getNL(). Example values: &quot;en_US&quot; and &quot;fr_FR_EURO&quot;.</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-nolazyregistrycacheloading</strong></pre>
              </td>
              <td width="65%">Deactivates platform plug-in registry cache loading optimization. By default, extensions&#39; configuration elements will be loaded from the registry cache (when available) only on demand, reducing memory footprint. This option will force the registry cache to be fully loaded at startup.</td>
              <td width="2%">2.1</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-noregistrycache</strong></pre>
              </td>
              <td width="65%">Bypasses the reading and writing of an internal plug-in registry cache file.</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-nosplash</strong></pre>
              </td>
              <td width="65%">Runs the platform without putting up the splash screen.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-os</strong> operatingSystem</pre>
              </td>
              <td width="65%">Defines the operating system on which the Eclipse platform is running. The Eclipse platform ordinarily computes the optimal setting using the prevailing value of Java os.name property. If specified here, this is the value that the Eclipse platform uses. The value specified here is available to plug-ins as BootLoader.getOS(), and used to resolve occurrences of the $os$ variable in paths mentioned in the plug-in manifest file. Example values: &quot;win32&quot;, &quot;linux&quot;, &quot;hpux&quot;, &quot;solaris&quot;, &quot;aix&quot;.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-password</strong> password</pre>
              </td>
              <td width="65%">The password for the authorization database. Used in conjunction with the -keyring option.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-perspective</strong> perspectiveId</pre>
              </td>
              <td width="65%">The perspective to open in the active workbench window on startup. If this parameter is not specified, the perspective that was active on shutdown will be opened.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-plugincustomization</strong>
	  propertiesFile</pre>
              </td>
              <td width="65%">The location of a properties file containing default settings for plug-in preferences. These default settings override default settings specified in the primary feature. Relative paths are interpreted relative to the directory that eclipse was started from.</td>
              <td width="2%">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-plugins</strong> pluginsFileURL</pre>
              </td>
              <td width="65%" height="16"><em>(Deprecated; replaced by -configuration; supported for 1.0 compatibility).</em> The location of the file that specifies where the Eclipse platform finds plug-ins, expressed as a URL. The file is in property file format where the keys are arbitrary user defined names and the values are comma separated lists of either explicit paths to plugin.xml files, or paths to directories containing plug-ins. Note that relative URLs are not allowed. If specified, this option causes the creation of a suitable temporary configuration.
              </td>
              <td width="2%" height="16">*1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-refresh</strong> </pre>
              </td>
              <td width="65%" height="16">Option for performing a global refresh of the workspace on startup. This will reconcile any changes that were made in the file system since the platform was last run. </td>
              <td width="2%" height="16">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-showlocation</strong> </pre>
              </td>
              <td width="65%" height="16">Option for displaying the location of the workspace in the window title bar. In release 2.0 this option only worked in conjunction with the -data command line argument.</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%" height="16"><pre><strong>-showsplash</strong> params</pre>
              </td>
              <td width="65%" height="16">Internal option for showing the splash screen (done by the executable Eclipse platform launcher). This option has different syntax and semantics at various points along the splash screen processing chain.</td>
              <td width="2%" height="16">2.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-vm</strong> vmPath</pre>
              </td>
              <td width="65%">The location of Java Runtime Environment (JRE) to use to run the Eclipse platform. If not specified, the JRE is at jre, sibling of the Eclipse executable. Relative paths are interpreted relative to the directory that eclipse was started from.</td>
              <td width="2%">1.0</td>
           </tr>
           <tr>
              <td vAlign="top" width="33%"><pre><strong>-ws</strong> windowSystem</pre>
              </td>
              <td width="65%">Defines the window system on which the Eclipse platform is running. The Eclipse platform ordinarily computes the optimal setting using the prevailing value of Java os.name property. If specified here, this is the value that the Eclipse platform uses. The value specified here is available to plug-ins as BootLoader.getWS(), used to configure SWT, and used to resolve occurrences of the $ws$ variable in paths mentioned in the plug-in manifest file. Example values: &quot;win32&quot;, &quot;motif&quot;, &quot;gtk&quot;.</td>
              <td width="2%">1.0</td>
           </tr>
       </tbody>
   </table>
   <p>All arguments following (but not including) the -vmargs entry are passed directly through to the indicated Java VM as virtual machine arguments (that is, before the class to run). <strong>Note:</strong> If an Eclipse startup argument, such as -data, is provided after the Java vm arguments (-vmargs), Eclipse will not start and you will receive a &quot;JVM terminated. Exit code=1&quot; error. 
   </p><h2>Running on Different VMs&#160;</h2><h3>Running Eclipse on J9</h3>
   <p>When running Eclipse on J9 version 1.5, it is recommended that you use the following VM options: </p><blockquote><pre>eclipse.exe [eclipse arguments] -vm path_to_j9w.exe 
            -vmargs -ms:32 -mm:2048 -mo:32768 -moi:32768 -mca:32 -mco:128 -mx:2000000</pre></blockquote>
   <p>When running Eclipse on J9 version 2.0, the default arguments chosen by J9W should be suitable. However, to override the parameters which are automatically set internally by the Eclipse executable, you must specify -vmargs with no following arguments as follows: </p><blockquote><pre>eclipse.exe [eclipse arguments] -vm path_to_j9w.exe -vmargs</pre></blockquote>
   <p>Please refer to the J9 VM documentation and help for further information.</p><h3>Running Eclipse on the IBM Developer Kit, Java(TM) Technology Edition VM</h3>
   <p>The default VM settings for IBM Developer Kit, Java(TM) Technology Edition 1.3 Linux work well for initial exploration, but are not sufficient for large scale development. For large scale development you should modify your VM arguments to make more heap available. For example, the following setting will allow the Java heap to grow to 256MB:&#160; </p><blockquote><pre>-vmargs -Xmx256M </pre></blockquote>
   <p>&#160;
<br/>
<br/>
<br/>
   </p>
</div><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/101112.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43016/" target="_blank">[新闻]华源热议：金融危机下的中国机会</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>js调试</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101085.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Wed, 02 Feb 2005 12:16:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101085.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/101085.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/02/101085.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/101085.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/101085.html</trackback:ping><description><![CDATA[<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=2f465be0-94fd-4569-b3c4-dffdf19ccd99&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?familyid=2f465be0-94fd-4569-b3c4-dffdf19ccd99&amp;displaylang=en</a> 
<br/>
<br/><a href="http://www.onestab.net/a/mozdev.html">http://www.onestab.net/a/mozdev.html</a> 
</p>
<p></p><A href="http://www.cnblogs.com/birdshome/archive/2004/12/30/83996.aspx">http://www.cnblogs.com/birdshome/archive/2004/12/30/83996.aspx</a> 
<p>
<br/><a href="http://www.oceanstudio.net/sps/default.aspx">http://www.oceanstudio.net/sps/default.aspx</a>
</p><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/101085.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43016/" target="_blank">[新闻]华源热议：金融危机下的中国机会</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>全面探讨PL/SQL的复合数据类型</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100629.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Tue, 01 Feb 2005 15:21:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100629.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/100629.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100629.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/100629.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/100629.html</trackback:ping><description><![CDATA[<a href="http://www.yesky.com/20020819/1625866.shtml">http://www.yesky.com/20020819/1625866.shtml</a><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/100629.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43015/" target="_blank">[新闻]Gartner:未来3年十大战略技术 虚拟化居首</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>嵌套表和可变数组</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100604.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Tue, 01 Feb 2005 14:34:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100604.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/100604.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100604.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/100604.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/100604.html</trackback:ping><description><![CDATA[<table height="400" cellSpacing="0" cellPadding="0" width="750" border="0">
   <tbody>
       <tr>
           <td vAlign="middle" align="center" height="40"><font size="5"><b>嵌套表和可变数组</b></font>
           </td>
       </tr>
       <tr>
           <td align="center" height="20"><font color="#999999" size="2"><small>本文出自:http://www.zhaoyang-db.com.cn 作者: (2002-04-26 08:02:00)</small></font>
           </td>
       </tr>
       <tr>
           <td align="center">
              <table cellSpacing="0" cellPadding="0" width="700" align="center" border="0">
                  <tbody>
                      <tr>
                            <td vAlign="top"><font color="#cccccc"><!--HTML_BEGIN-->
                            <table border="0">
                            <tbody>
                            <tr>
                            <td vAlign="top" width="700" height="627"><blockquote>
                            <p>&#160;</p><o:p></o:p>
                            <p align="center"><b><font size="4">嵌套表</font></b><font size="4"><b><o:p></o:p></b></font><b><o:p></o:p></b>
                            </p>
                            <p>一、嵌套表的定义：<o:p></o:p>
                            </p>
                            <p>　　嵌套表是表中之表。一个嵌套表是某些行的集合，它在主表中表示为其中的一列。对主表中的每一条记录，嵌套表可以包含多个行。在某种意义上，它是在一个表中存储一对多关系的一种方法。考查一个包含部门信息的表，在任何时间内每个部门会有很多项目正在实施。在一个严格的关系模型中，将需要建立两个独立的表department和project。</p>
                            <p>　　嵌套表允许在department表中存放关于项目的信息。勿需执行联合操作，就可以通过department表直接访问项目表中的记录。这种不经联合而直接选择数据的能力使得用户对数据访问更加容易。甚至在并没有定义方法来访问嵌套表的情况下，也能够很清楚地把部门和项目中的数据联系在一起。在严格的关系模型中，department和project两个表的联系需要通过外部关键字（外键）关系才能实现。</p>
                            <p><o:p></o:p>
                            </p>
                            <p>二、举例说明嵌套表的使用：</p>
                            <p>　　假设有一个关于动物饲养员的表，希望其中具有他们饲养的动物的信息。用一个嵌套表，就可以在同一个表中存储饲养员和其饲养的全部动物的信息。</p>
                            <p>1、创建类型animal_ty：此类型中，对于每个动物都包含有一个记录，记载了其品种、名称和出生日期信息。</p><blockquote>
                            <p>CREATE TYPE animal_ty AS OBJECT (</p><blockquote>
                            <p>breed varchar2(25), </p>
                            <p>name varchar2(25), </p>
                            <p>birthdate date); </p></blockquote></blockquote>
                            <p>2、创建animals_nt：此类型将用作一个嵌套表的基础类型。</p><blockquote>
                            <p>CREATE TYPE animals_nt as table of animal_ty;</p></blockquote>
                            <p>3、创建表breeder：饲养员的信息表</p><blockquote>
                            <p>create table breeder</p><blockquote>
                            <p>(breedername varchar2(25),</p>
                            <p>animals animal_nt)</p>
                            <p>nested table animals store as animals_nt_tab;</p></blockquote></blockquote>
                            <p>4、向嵌套表中插入记录</p><blockquote>
                            <p>insert into breeder </p>
                            <p>values(&#39;mary&#39;,animal_nt(animal_ty(&#39;dog&#39;,&#39;butch&#39;,&#39;31-MAR-97&#39;),</p>
                            <p>animal_ty(&#39;dog&#39;,&#39;rover&#39;,&#39;31-MAR-97&#39;),</p>
                            <p>animal_ty(&#39;dog&#39;,&#39;julio&#39;,&#39;31-MAR-97&#39;)));</p>
                            <p>insert into breeder </p>
                            <p>values(&#39;jane&#39;,animal_nt(animal_ty(&#39;cat&#39;,&#39;an&#39;,&#39;31-MAR-97&#39;),</p>
                            <p>animal_ty(&#39;cat&#39;,&#39;jame&#39;,&#39;31-MAR-97&#39;),</p>
                            <p>animal_ty(&#39;cat&#39;,&#39;killer&#39;,&#39;31-MAR-97&#39;)));</p>
                            <p>commit;</p></blockquote>
                            <p>5、查询嵌套表</p><blockquote>
                            <p>select name,birthdate from </p>
                            <p>table(select animals from breeder);</p>
                            <p>select name,birthdate from </p>
                            <p>table(select animals from breeder </p>
                            <p>where breedername=&#8217;mary&#8217;)</p>
                            <p>where name=&#8217;dog&#8217;;</p></blockquote>
                            <p><o:p></o:p>三、嵌套表的特点：
                            </p>
                            <p>1、对象复用：如果编写面向对象的代码，就提高了重用以前编写的代码模块的机会。同样，如果创建面向对象的数据库对象，也就提高了数据库对象能够被重用的机会。</p>
                            <p>2、标准支持：如果创建标准的对象，那么它们被重用的机会就会提高。如果有多个应用或多个表使用同一数据库对象集合，那么它就是既成事实的数据库对象标准。</p>
                            <p>3、定义访问路径：对于每一个对象，用户可定义在其上运行的过程和函数，从而可以使数据和访问此数据的方法联合起来。有了用这种方式定义的访问路径，就可以标准化数据访问的方法并提高对象的可复用性。</p>
                            <p><o:p></o:p>
                            </p>
                            <p align="center"><b>可变数组</b><b><o:p></o:p></b>
                            </p>
                            <p>一、可变数组的定义：<o:p></o:p>
                            </p>
                            <p>　　可变数组与嵌套表相似，也是一种集合。一个可变数组是对象的一个集合，其中每个对象都具有相同的数据类型。可变数组的大小由创建时决定。在表中建立可变数组后，可变数组在主表中作为一个列对待。从概念上讲，可变数组是一个限制了行集合的嵌套表。</p>
                            <p>　　可变数组，允许用户在表中存储重复的属性。例如：假设用户有一个project表，并在项目中指定了工作人员，一个项目可以有多个工人，而一个工人也可以为多个项目工作。在严格的关系模型中，用户可以创建一个project表，一个worker表和存储它们之间关系的交叉表project_worker。</p>
                            <p>　　用户可使用可变数组在project表中存储工人的名字。如果项目限定的工人数不超过10人，可以建立一个以10个数据项为限的可变数组。接下来就可处理此可变数组，从而对于每一个项目，可以选取其中所有工人的名字，而勿需查询表worker。</p>
                            <p><o:p></o:p>
                            </p>
                            <p>二、举例说明可变数组的使用：</p>
                            <p>1、创建类型comm_info</p><blockquote>
                            <p>CREATE TYPE comm_info AS OBJECT ( /*此类型为通讯方式的集合</p><blockquote>
                            <p>no number(3), /*通讯类型号</p>
                            <p>comm_type varchar2(20), /*通讯类型</p>
                            <p>comm_no varchar2(30)); /*号码</p></blockquote></blockquote>
                            <p>2、创建可变数组comm_info_list</p><blockquote>
                            <p>CREATE TYPE comm_info_list AS </p>
                            <p>VARRAY(50) OF comm_info;</p></blockquote>
                            <p>3、创建表</p><blockquote>
                            <p>create table user_info</p><blockquote>
                            <p>(user_id number(6), /*用户ID号</p>
                            <p>user_name varchar2(20), /*用户名称</p>
                            <p>user_comm comm_info_list); /*与用户联系的通讯方式</p></blockquote></blockquote>
                            <p>4、向可变数组插入记录</p><blockquote>
                            <p>insert into user_info</p>
                            <p>values(1,&#39;mary&#39;,comm_info_list(comm_info(1,&#39;手机&#39;,&#39;13651401919&#39;),</p>
                            <p>comm_info(2,&#39;呼机&#39;,&#39;1281234567&#39;)));</p>
                            <p>insert into user_info</p>
                            <p>values(2,&#39;carl&#39;,comm_info_list(comm_info(1,&#39;手机&#39;,&#39;13901018888&#39;),</p>
                            <p>comm_info(2,&#39;呼机&#39;,&#39;1281234567&#39;)));</p>
                            <p>commit;</p></blockquote>
                            <p>5、查询可变数组</p><blockquote>
                            <p>select user_comm from user_info </p>
                            <p>where user_id=1;<o:p></o:p>
                            </p>
                            <p>select comm_type,comm_no </p>
                            <p>from table(select user_comm from user_info </p>
                            <p>where user_id=1)</p>
                            <p>where no=1;</p></blockquote>
                            <p>　　与一位用户联系的方式有很多种，比如：手机、呼机、座机等。在一个严格的关系模型中，将需要两个独立的表：用户信息和通讯方式，而在可变数组中，允许在表user_info中直接访问用户的联系方式，这种不经联合而直接选择数据的能力使得用户对数据的访问更加容易。</p>
                            <p>三、可变数组的特点：</p>
                            <p>1、对象复用：如果编写面向对象的代码，就提高了重用以前编写的代码模块的机会。同样，如果创建面向对象的数据库对象，也就提高了数据库对象能够被重用的机会。</p>
                            <p>2、标准支持：如果创建标准的对象，那么它们被重用的机会就会提高。如果有多个应用或多个表使用同一数据库对象集合，那么它就是既成事实的数据库对象标准。</p>
                            <p>3定义访问路径：对于每一个对象，用户可定义在其上运行的过程和函数，从而可以使数据和访问此数据的方法联合起来。有了用这种方式定义的访问路径，就可以标准化数据访问的方法并提高对象的可复用性。</p></blockquote>
                            </td>
                            </tr>
                            </tbody>
                            </table></font>
                            </td>
                      </tr>
                  </tbody>
              </table>
           </td>
       </tr>
   </tbody>
</table><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/100604.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43015/" target="_blank">[新闻]Gartner:未来3年十大战略技术 虚拟化居首</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Spring 调用ORACLE存储过程的结果集 </title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100571.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Tue, 01 Feb 2005 13:21:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100571.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/100571.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100571.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/100571.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/100571.html</trackback:ping><description><![CDATA[<p><a href="http://blog.csdn.net/sunsnow8/archive/2005/01/10/246588.aspx">http://blog.csdn.net/sunsnow8/archive/2005/01/10/246588.aspx</a>
<br/>
<br/>oracle 对于高级特性总是与众不同(我极力讨厌这一点,如果使用它的产品就要对这种产品
<br/>进行特定的编程,这也是我从不看好weblogic之类的平台的原因),大对象存取一要定用它自己
<br/>的LOB对象,所幸我还能通过LONG RAW来代替.以便能使程序不需要特定的编码.但对于存储过程
<br/>(我是说返回结果集的存储过程),我还没有什么方法能用一个通用的程序来处理ORACLE.太多的
<br/>教材或文章在讲存储过程的调用只是不负责任地简单执行一些涵数或无结果返回的存储过程,
<br/>使大多数读者根本不知道到底如何调用存储过程的结果集.而在Spring中,根本就没有真正完全
<br/>地介绍对存储过程的结果集的处理,更别说象oracle这种&quot;特别&quot;的存储过程的结果集处理.
</p>
<p>先来简单看一下我们如何在JDBC中处理存储过程的结果集的通用流程:</p>
<p>1.获取CallableStatement语句:</p>
<p>CallableStatement cs = conn.prepareCall(&quot;{call spName(?,?,?)}&quot;);</p>
<p>2.传入输入参数和注册输出参数</p>
<p>cs.setXXX(index,value);//输入参数
<br/>cs.registerOutParameter(index,type);//输出参数
</p>
<p>3.执行存储过程:</p>
<p>cs.execute();</p>
<p>对于一个存诸过程,如果返回的结果是我们预先知道的,那么可以根据存储过程定义的顺序来进行
<br/>处理(事实上一般不会这样),但对于复杂的多结果集的处理,如何定义一个通用的流程?
</p>
<p>我们先看一下JDBC本身能为我们提供什么?
<br/>一个存储过程执行后返回的是boolean型:
<br/>boolean flag = callableStatement.execute();
<br/>如果flag为true,那么说明返回了一个结果集(ResultSet)类型,你可以用getResultSet()得到当前行所在
<br/>的结果,而如果返回为flase,说明什么呢?
</p>
<p>如果你不进行处理,什么也不能说明,只能说明当前指针不是ResultSet,有可能是更新计数(updateCount)
<br/>也可能什么也没有反因.
</p>
<p>那么如果当前指针为flase时如何处理?我们应该先getUpdateCount();如果返回-1,既不是结果集,又
<br/>不是更新计数了.说明没的返回了.而如果getUpdateCount()返回0或大于0,则说明当前指针是更新计数(
<br/>0的时候有可能是DDL指令).无论是返回结果集或是更新计数,那么则可能还继续有其它返回.只有在当前
<br/>指指针getResultSet()==null &amp;&amp; getUpdateCount() == -1才说明没有再多的返回.
</p>
<p>存储过程的返回和ResultSet类似,每次处理的返回结果相当于是ResultSet的Row,只不过存储过程的Row
<br/>最先在第一行而不是象ResultSet要先next才到第一行,存储过程向下移动一行用getMoreResults(),相
<br/>当于ResultSet的next().同样它返回boolean和上面的flag一样,只是说明当前行是不是ResultSet,如果是
<br/>flase,你还是要判断是不是updateCount,在每一行,都要先同时判断是否为ResultSet还是UpdateCount,如
<br/>果是其中一种则要继续getMoreResults(),当不是ResultSet也不是updateCount时,说明没有返回结果了,
<br/>这时再获取输出参数.
</p>
<p>看明白了吗?</p>
<p>那我们就根据上面的规则来写一个通用的流程吧:</p>
<p>首先,我们要确定什么时候没说结果集了:
<br/>if(cs.getResultSet() == null &amp;&amp; cs.getUpdateCount() == -1)
<br/>现在我们做一个循环:
<br/>ResultSet rs = null;
<br/>int updateCount = -1;
<br/>flag = cs.execute();
<br/>do{
<br/>&#160;&#160;&#160; updateCount = cs.getUpdateCount();
<br/>&#160;&#160;&#160; if(updateCount != -1){//说明当前行是一个更新计数
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; //处理.
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; cs.getMoreResults();
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; continue;//已经是更新计数了,处理完成后应该移动到下一行
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //不再判断是否是ResultSet
<br/>&#160;&#160;&#160; }
<br/>&#160;&#160;&#160; rs = cs.getResultSet();
<br/>&#160;&#160;&#160; if(rs != null){//如果到了这里,说明updateCount == -1
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; //处理rs
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; cs.getMoreResults();
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; continue;
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //是结果集,处理完成后应该移动到下一行
<br/>&#160;&#160;&#160; }
<br/>&#160;&#160;&#160; //如果到了这里,说明updateCount == -1 &amp;&amp; rs == null,什么也没的了
<br/>&#160;&#160;&#160; 
<br/>}while(!(updateCount == -1 &amp;&amp; rs == null));
<br/>cs.getXXX(int);//获取输出参数 
</p>
<p>
<br/>以上是对于通用的存储过程返回的结果集的处理,而oracle,它不能返回结果集,只能在输出参数中
<br/>返回一个cursor,所以通用的流程中你获取不到任何结果:
</p>
<p>package PK_AREA_PUBLIC is
<br/>&#160; TYPE serarch_result IS REF CURSOR;
<br/>&#160; PROCEDURE&#160; area_search(vTarget_in IN VARCHAR2 ,cur_result_out OUT serarch_result) ;
<br/>end PK_AREA_PUBLIC;
</p>
<p>package body PK_AREA_PUBLIC is
<br/>&#160; PROCEDURE&#160; area_search(vTarget_in IN VARCHAR2 ,cur_result_out OUT serarch_result)
<br/>&#160; IS
<br/>&#160; sqlstr VARCHAR2(1000);
<br/>&#160; BEGIN
<br/>&#160;&#160;&#160;&#160;&#160;&#160; sqlstr:=&#39;select .................................&#39;;
<br/>&#160;&#160;&#160;&#160;&#160;&#160; OPEN cur_result_out FOR sqlstr USING vTarget_in;
<br/>&#160; END area_search;
<br/>end PK_AREA_PUBLIC;
</p>
<p>
<br/>对于上面的例子,存储过程有一个输入参数,一个输出参数,我们要接受输出参数作为结果集处理.所
<br/>以注册的时候应该注册为:
</p>
<p>cs.registerOutParameter(2,oracle.jdbc.OracleTypes.CURSOR);//输出参数</p>
<p>这样在存储过程执行后,获取输出数造型为ResultSet就可以处理:</p>
<p>ResultSet rs = (ResultSet)cs.getObject(2);</p>
<p>如果有多个结果集就用多个输出参数.</p>
<p>
<br/>明白了ORACLE的特殊性,我们再看看在spring中如果处理它的存储过程的结果集:
<br/>spring在处理复杂对象的时候,大都采用回调的方法,要求程序员自己实现接口方法.也就是它提供了
<br/>程序运行时的参数,要求你自己对这些参数进行处理.对于JdbcTemplate,它在很多地方提供了ResultSet
<br/>参数供程序员处理.在Spring文档中提供了对于通用流程,也就是从存储过程执行结果中获取结果集的
<br/>例程:
</p>
<p>Map out = execute(new HashMap());
<br/>其实它是默认实现了上面JDBC通用流程中对ResuleSet到Map的封装.而对于Oracle,我们就必须自己手
<br/>实现对输出参数中ResultSet的回调:
</p>
<p>public class SpringStoredProcedure
<br/>&#160;&#160;&#160; extends StoredProcedure {
<br/>&#160; public ArrayList&lt;HashMap&gt; set = new ArrayList&lt;HashMap&gt;();
<br/>&#160; //声明一个用于接收结果集的数据结构,其中的元素为row,用map存放
</p>
<p>&#160; private Map inParam;//输入参数
<br/>&#160; private RowMapper rm = new RowMapper(){
<br/>&#160;&#160;&#160; public Object mapRow(ResultSet rs,int rowNum) throws SQLException{
<br/>&#160;&#160;&#160;&#160;&#160; return null;//不用从存储过程本身获取结果
<br/>&#160;&#160;&#160; }
<br/>&#160; };
</p>
<p>&#160; private RowMapperResultReader callback = new RowMapperResultReader(rm ){
<br/>&#160;&#160;&#160; public void processRow(ResultSet rs) //回调处理
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throws SQLException{
<br/>&#160;&#160;&#160;&#160;&#160; int count = rs.getMetaData().getColumnCount();
<br/>&#160;&#160;&#160;&#160;&#160; String[] header = new String[count];
<br/>&#160;&#160;&#160;&#160;&#160; for(int i=0;i&lt;count;i++)
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; header[i] = rs.getMetaData().getColumnName(i+1);
<br/>&#160;&#160;&#160;&#160;&#160; while(rs.next()){
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; HashMap&lt;String,String&gt; row = new HashMap(count+7);
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; for(int i=0;i&lt;count;i++)
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; row.put(header[i],rs.getString(i+1));
<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; set.add(row);
<br/>&#160;&#160;&#160;&#160;&#160; }
<br/>&#160;&#160;&#160; }
<br/>&#160; }; //RowMapperResultReader作为输出参数的回调句柄
<br/>&#160; public SpringStoredProcedure(DataSource ds, String SQL) {
<br/>&#160;&#160;&#160; setDataSource(ds);
<br/>&#160;&#160;&#160; setSql(SQL);
<br/>&#160; }
</p>
<p>&#160; public void setOutParameter(String column,int type){
<br/>&#160;&#160;&#160; declareParameter(new SqlOutParameter(column, type,callback));
<br/>&#160;&#160;&#160;&#160;//利用回调句柄注册输出参数
<br/>&#160; }
<br/>&#160; public void setParameter(String column,int type){
<br/>&#160;&#160;&#160; declareParameter(new SqlParameter(column, type));
<br/>&#160; }
<br/>&#160; 
<br/>&#160; public void SetInParam(Map inParam){
<br/>&#160;&#160;&#160; this.inParam = inParam;
<br/>&#160; }
</p>
<p>&#160; public Map execute() {
<br/>&#160;&#160;&#160; compile();
<br/>&#160;&#160;&#160; return execute(this.inParam);
<br/>&#160; }
<br/>}
</p>
<p>下面我们看一下调用过程:</p>
<p>&#160;&#160;&#160; 
<br/>&#160;&#160;&#160; DriverManagerDataSource ds = .......;
</p>
<p>&#160;&#160;&#160; SpringStoredProcedure sp = new SpringStoredProcedure(ds,&quot;PK_AREA_PUBLIC.area_search&quot;);
<br/>&#160;&#160;&#160; 
<br/>&#160;&#160;&#160; //注册参数类型,输入参数和输出参数同时注册,否则不能正确编译存储过程
<br/>&#160;&#160;&#160; sp.setParameter(&quot;vTarget_in&quot;,java.sql.Types.VARCHAR);
<br/>&#160;&#160;&#160; sp.setOutParameter(&quot;cur_result_out&quot;,oracle.jdbc.OracleTypes.CURSOR);
<br/>&#160;&#160;&#160; sp.compile();
<br/>&#160;&#160;&#160; 
<br/>&#160;&#160;&#160; //传入输入参数值
<br/>&#160;&#160;&#160; Map in = new HashMap();
<br/>&#160;&#160;&#160; in.put(&quot;vTarget_in&quot;,&quot;一个内容&quot;);
<br/>&#160;&#160;&#160; sp.SetInParam(in);
<br/>&#160;&#160;&#160; 
<br/>&#160;&#160;&#160; //执行存储过程
<br/>&#160;&#160;&#160; sp.execute();
</p>
<p>&#160;&#160;&#160; Map m = sp.set.get(0);//ReultSet的第一条记录
<br/>&#160;&#160;&#160;&#160; //set定义为SpringStoredProcedure的属性用于接收回调时的数据
<br/>&#160;&#160;&#160;&#160; //如果有多个输出参数,应该在每个输出参数的回调方法中生成该输出
<br/>&#160;&#160;&#160;&#160; //参数对应的ArrayList,然后加到一个成员变量的数据结构中.
<br/>&#160;&#160;&#160; Iterator i = m.keySet().iterator();
<br/>&#160;&#160;&#160; while(i.hasNext()){
<br/>&#160;&#160;&#160;&#160;&#160; String key = i.next().toString();
<br/>&#160;&#160;&#160;&#160;&#160; System.out.println(key + &quot;=&gt;&quot; + m.get(key));
<br/>&#160;&#160;&#160; }
</p>
<p>&#160; 总之,上面的方法虽然解决了Spring中对Oracle存储过程的调用,但我极力不推荐这程复杂的处理</p><b>
<br/></b><b>
<br/>
<br/>版权声明：CSDN是本Blog托管服务提供商。如本文牵涉版权问题，CSDN不承担相关责任，请版权拥有者直接与文章作者联系解决。</b>
<br/>
<br/><img src ="http://www.cnblogs.com/sunsonbaby/aggbug/100571.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/43015/" target="_blank">[新闻]Gartner:未来3年十大战略技术 虚拟化居首</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>http://www.cnoug.org/viewthread.php?tid=9292</title><link>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100557.html</link><dc:creator>笨笨</dc:creator><author>笨笨</author><pubDate>Tue, 01 Feb 2005 12:39:00 GMT</pubDate><guid>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100557.html</guid><wfw:comment>http://www.cnblogs.com/sunsonbaby/comments/100557.html</wfw:comment><comments>http://www.cnblogs.com/sunsonbaby/archive/2005/02/01/100557.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/sunsonbaby/comments/commentRss/100557.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sunsonbaby/services/trackbacks/100557.html</trackback:ping><description><![CDATA[<a href="http