﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-jspark</title><link>http://www.blogjava.net/jspark/</link><description>星星之火、可以燎原</description><language>zh-cn</language><lastBuildDate>Wed, 29 Apr 2026 20:23:44 GMT</lastBuildDate><pubDate>Wed, 29 Apr 2026 20:23:44 GMT</pubDate><ttl>60</ttl><item><title>如何更方便地进行CSV格式文件读写</title><link>http://www.blogjava.net/jspark/archive/2008/10/31/237819.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Fri, 31 Oct 2008 06:42:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2008/10/31/237819.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/237819.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2008/10/31/237819.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/237819.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/237819.html</trackback:ping><description><![CDATA[&nbsp;
<p style="line-height: 150%"><strong>&nbsp;</strong></p>
<h1>1<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: 仿宋_GB2312">基本介绍</span></h1>
<p><span style="font-family: 仿宋_GB2312">可以说</span>CSV<span style="font-family: 仿宋_GB2312">格式的文件经常碰到，何为</span>CSV<span style="font-family: 仿宋_GB2312">格式，</span>CVS<span style="font-family: 仿宋_GB2312">全称</span>comma-separated values<span style="font-family: 仿宋_GB2312">，就是典型的用逗号隔开的文件，比如下面这种文件格式</span></p>
<p>Name,company</p>
<p>zhangsan,ibm</p>
<p>lisi,oracle</p>
<p><span style="font-family: 仿宋_GB2312">这种就是典型的</span>CSV<span style="font-family: 仿宋_GB2312">格式文件。不过也可以扩展到其它符号隔开的字符，比如</span></p>
<p>Name#company</p>
<p>Zhangsan#ibm</p>
<p>Lisi#oracle</p>
<p><span style="font-family: 仿宋_GB2312">这种也算</span>CSV<span style="font-family: 仿宋_GB2312">格式</span></p>
<p>Java<span style="font-family: 仿宋_GB2312">开源框架</span>CVSReader<span style="font-family: 仿宋_GB2312">提供了一个轻量级、简单方便的统一操作接口可用，下面具体讲解如何操作</span>CVS<span style="font-family: 仿宋_GB2312">格式</span></p>
<h1>2<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: 仿宋_GB2312">安装和使用</span></h1>
<h2><span style="font-family: 宋体">2.1</span><span style="font-family: 仿宋_GB2312">下载</span></h2>
<p><span style="font-family: 仿宋_GB2312">目前</span>CSV reader<span style="font-family: 仿宋_GB2312">的最新发布版本是</span>1.8<span style="font-family: 仿宋_GB2312">。我们可以从</span></p>
<p><a href="http://opencsv.sourceforge.net/">http://opencsv.sourceforge.net/</a></p>
<p><span style="font-family: 仿宋_GB2312">上面下载到最新的</span>csvreader<span style="font-family: 仿宋_GB2312">包。</span></p>
<h2><span style="font-family: 宋体">2.2</span><span style="font-family: 仿宋_GB2312">安装</span></h2>
<p><span style="font-family: 仿宋_GB2312">直接把</span>jar<span style="font-family: 仿宋_GB2312">包分别存放到开发工程的类路径下面即可使用。</span></p>
<h1>3<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: 仿宋_GB2312">读取</span>CSV<span style="font-family: 仿宋_GB2312">格式文件</span></h1>
<h2><span style="font-family: 宋体">3.1</span><span style="font-family: 仿宋_GB2312">基本简介</span></h2>
<p><span style="font-family: 仿宋_GB2312">首先，读取</span>CSV<span style="font-family: 仿宋_GB2312">格式的文件需要创建一个</span>CSVReader<span style="font-family: 仿宋_GB2312">，如下</span></p>
<p>CsvReader reader = new CsvReader(Reader r, &nbsp;char c);</p>
<p><span style="font-family: 仿宋_GB2312">其中第一个参数为读取文件，第二个参数为分割符，比如&#8220;</span>,<span style="font-family: 仿宋_GB2312">&#8221;，或者&#8220;</span>#<span style="font-family: 仿宋_GB2312">&#8221;</span></p>
<p><span style="font-family: 仿宋_GB2312">另外，也有其它几个参数，可以查阅</span>API<span style="font-family: 仿宋_GB2312">，比如</span></p>
<p>CsvReader reader = new CsvReader(InputStream r, &nbsp;char c, Charset charset);<span style="font-family: 仿宋_GB2312">等等</span></p>
<p><span style="font-family: 仿宋_GB2312">其次，一般需要读取头信息，如下：</span></p>
<p>reader.readHeaders();</p>
<p>String[] headers = reader.getHeaders();</p>
<p><span style="font-family: 仿宋_GB2312">读取了后，指针就会移动到下一行，也就是可以开始读取文件内容</span></p>
<p><span style="font-family: 仿宋_GB2312">假如，有多行的话，可以用一个循环套入，例如下面：</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (reader.readRecord()) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; headers.length; i++) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String value = reader.get(headers[i]);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.print(value+"&nbsp;");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<h2><span style="font-family: 宋体">3.2</span><span style="font-family: 仿宋_GB2312">综合例子</span></h2>
<p><span style="font-family: 仿宋_GB2312">在</span>C<span style="font-family: 仿宋_GB2312">盘下创建一个测试文件</span>test.cvs<span style="font-family: 仿宋_GB2312">，内容如下：</span></p>
<p>a#b#c</p>
<p>1#2#3</p>
<p>4#5#6</p>
<p><span style="font-family: 仿宋_GB2312">下面是解析代码：</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static void main(String[] args) throws Exception {</p>
<p style="margin-left: 59.35pt; text-indent: 0cm">CsvReader reader = new CsvReader(new FileReader("c://csv.txt"), '#');</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader.readHeaders();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String[] headers = reader.getHeaders();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (reader.readRecord()) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; headers.length; i++) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String value = reader.get(headers[i]);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.print(value+"&nbsp;");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p><span style="font-family: 仿宋_GB2312">运行以上程序，可以看到输出</span></p>
<p>&nbsp;1 2 3</p>
<p>&nbsp;4 5 6</p>
<h1>4<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: 仿宋_GB2312">写</span>CSV<span style="font-family: 仿宋_GB2312">格式文件</span></h1>
<p><span style="font-family: 仿宋_GB2312">写</span>CSV<span style="font-family: 仿宋_GB2312">格式文件也比较简单，写每一列只要直接调用</span></p>
<p><span style="font-size: 10pt; color: black; font-family: 'Courier New'">csvWriter.write()</span><span style="font-size: 10pt; color: black; font-family: 宋体">即可</span></p>
<p><span style="font-family: 仿宋_GB2312">另外，写完每行结束后，都要调用</span> <span style="font-size: 10pt; color: black; font-family: 'Courier New'">csvWriter.endRecord();</span></p>
<p><span style="font-family: 仿宋_GB2312">表示结束一行</span></p>
<p><span style="font-family: 仿宋_GB2312">文件写完毕后，要记得刷新一下并关掉，如下：</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.flush();</span></p>
<p><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.close();</span></p>
<p><span style="font-family: 仿宋_GB2312">代码如下：</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp; </span><strong><span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'">public</span></strong><strong><span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'">static</span></strong><strong><span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'">void</span></strong><span style="font-size: 10pt; color: black; font-family: 'Courier New'"> main(String[] args) </span><strong><span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'">throws</span></strong><span style="font-size: 10pt; color: black; font-family: 'Courier New'"> Exception {</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CsvWriter csvWriter = </span><strong><span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'">new</span></strong><span style="font-size: 10pt; color: black; font-family: 'Courier New'"> CsvWriter(</span><strong><span style="font-size: 10pt; color: #7f0055; font-family: 'Courier New'">new</span></strong><span style="font-size: 10pt; color: black; font-family: 'Courier New'"> FileWriter(</span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">"c://test.text"</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">), </span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">'#'</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">);</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.write(</span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">"name"</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">);</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.write(</span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">"company"</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">);</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.endRecord();</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.write(</span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">"11"</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">);</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.write(</span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">"12"</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">);</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.endRecord();</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.write(</span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">"21"</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">);</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.write(</span><span style="font-size: 10pt; color: #2a00ff; font-family: 'Courier New'">"22"</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">);</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.flush();</span></p>
<p style="margin-top: 0cm; text-indent: 0cm; text-align: left" align="left"><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; csvWriter.close();</span></p>
<p><span style="font-size: 10pt; color: black; font-family: 'Courier New'">&nbsp;&nbsp; }</span></p>
<p><span style="font-size: 10pt; color: black; font-family: 'Courier New'">}</span></p>
<p><span style="font-size: 10pt; color: black; font-family: 宋体">运行以上程序，可以看到</span><span style="font-size: 10pt; color: black; font-family: 'Courier New'">C</span><span style="font-size: 10pt; color: black; font-family: 宋体">盘下面创建了一个文件</span></p>
<p>test.text</p>
<p><span style="font-family: 仿宋_GB2312">内容如下：</span></p>
<p>name#company</p>
<p>11#12</p>
<p>21#22</p>
<img src ="http://www.blogjava.net/jspark/aggbug/237819.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2008-10-31 14:42 <a href="http://www.blogjava.net/jspark/archive/2008/10/31/237819.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JbossRules入门（二）</title><link>http://www.blogjava.net/jspark/archive/2008/10/28/237135.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Tue, 28 Oct 2008 07:54:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2008/10/28/237135.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/237135.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2008/10/28/237135.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/237135.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/237135.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: （本文档的全篇可以到博客下面的文件列表下载，地址下面）&nbsp; http://www.blogjava.net/jspark/admin/Files.aspx为了让尽快对jbossRules有一个感官的认识，下面先开发一个HelloWorld的程序。建立一个java工程，目录如下：&nbsp;&nbsp;如上所示，建立一个com包，然后在下面分别建立一个Sa...&nbsp;&nbsp;<a href='http://www.blogjava.net/jspark/archive/2008/10/28/237135.html'>阅读全文</a><img src ="http://www.blogjava.net/jspark/aggbug/237135.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2008-10-28 15:54 <a href="http://www.blogjava.net/jspark/archive/2008/10/28/237135.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JbossRules入门（一）</title><link>http://www.blogjava.net/jspark/archive/2008/10/28/237071.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Tue, 28 Oct 2008 04:15:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2008/10/28/237071.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/237071.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2008/10/28/237071.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/237071.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/237071.html</trackback:ping><description><![CDATA[&nbsp;
<h1>1<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Java<span style="font-family: 仿宋_GB2312">规则系统简介</span></h1>
<p><span style="font-family: 仿宋_GB2312">在大型商业系统中，业务规则、商业逻辑等等都会比较复杂。而且在很多大型系统当中，很多业务规则、商业逻辑并不是一成不变的。甚至当系统进入生产阶段时，客户的业务规则、商业逻辑也会改变。某些系统要求甚至更高，要求能</span>24<span style="font-family: 仿宋_GB2312">小时不停机，并且能够实时修改商业规则。这就对商业系统提出了较大的挑战。如果将这些可变的规则直接编写到代码里面的话，业务规则一旦改变，就要修改代码。并由此带来编译、打包、发布等等问题。这对于生产系统来说是极不方便的。因此，如何考虑把一些可变的业务规则抽取到外面，使这些业务规则独立于程序代码。并最好是能够实时的修改业务规则，这样就可以做到不用打包编译发布等等。</span></p>
<p><span style="font-family: 仿宋_GB2312">值得庆幸的是现在出现了一些</span>Java<span style="font-family: 仿宋_GB2312">规则引擎（</span>Rule Engine<span style="font-family: 仿宋_GB2312">），专门解决以上所述的问题。利用它，我们就可以在应用系统中分离客户的商业决策逻辑和应用开发者的技术决策，并把这些商业规额则放在中心数据库或其他统一的地方，让它们能在运行时可以动态地管理和修改。</span></p>
<p>JbossRules<span style="font-family: 仿宋_GB2312">是一个优秀的</span>JAVA<span style="font-family: 仿宋_GB2312">规则引擎，其前身是</span>Drools3<span style="font-family: 仿宋_GB2312">，后来被</span>Jboss<span style="font-family: 仿宋_GB2312">合并并改名为</span>JbossRules</p>
<h2><span style="font-family: 宋体">1.1</span><span style="font-family: 仿宋_GB2312">基于规则的专家系统简介</span></h2>
<p><span style="font-family: 仿宋_GB2312">人工智能是一个新兴的学科，它是想让计算机模拟人脑的思维和推理模式。人工智能分成如下几个主要的分学科：</span></p>
<p><span style="font-family: 仿宋_GB2312">知识表示</span></p>
<p><span style="font-family: 仿宋_GB2312">神经网络</span></p>
<p><span style="font-family: 仿宋_GB2312">基因算法</span></p>
<p><span style="font-family: 仿宋_GB2312">决策树</span></p>
<p><span style="font-family: 仿宋_GB2312">专家系统</span></p>
<p><span style="font-family: 仿宋_GB2312">等等几个学科</span></p>
<p><span style="font-family: 仿宋_GB2312">知识表示是人工智能中的一个基础领域，其目的是如何更好的在计算机当中描述已存在的事实。专家系统就是使用知识表示，来做规则推理，得出最后的结论来。</span></p>
<p>Java<span style="font-family: 仿宋_GB2312">规则引擎起源于基于规则的专家系统，而基于规则的专家系统又是专家系统的其中一个分支。专家系统属于人工智能的范畴，它模仿人类的推理方式，使用试探性的方法进行推理，并使用人类能理解的术语解释和证明它的推理结论。为了更深入地了解</span>Java<span style="font-family: 仿宋_GB2312">规则引擎，下面简要地介绍基于规则的专家系统。</span>RBES<span style="font-family: 仿宋_GB2312">包括三部分：</span>Rule Base<span style="font-family: 仿宋_GB2312">（</span>knowledge base<span style="font-family: 仿宋_GB2312">）、</span>Working Memory<span style="font-family: 仿宋_GB2312">（</span>fact base<span style="font-family: 仿宋_GB2312">）和</span>Inference Engine<span style="font-family: 仿宋_GB2312">。它们的结构如下系统所示：</span></p>
<p><span style="font-family: 仿宋_GB2312">如上图所示，推理引擎包括三部分：模式匹配器（</span>Pattern Matcher<span style="font-family: 仿宋_GB2312">）、议程（</span>Agenda<span style="font-family: 仿宋_GB2312">）和执行引擎（</span>Execution Engine<span style="font-family: 仿宋_GB2312">）。推理引擎通过决定哪些规则满足事实或目标，并授予规则优先级，满足事实或目标的规则被加入议程。模式匹配器决定选择执行哪个规则，何时执行规则；议程管理模式匹配器挑选出来的规则的执行次序；执行引擎负责执行规则和其他动作。</span></p>
<p style="text-indent: 19.85pt"><span style="font-family: 仿宋_GB2312">和人类的思维相对应，推理引擎存在两者推理方式：演绎法（</span>Forward-Chaining<span style="font-family: 仿宋_GB2312">）和归纳法（</span>Backward-Chaining<span style="font-family: 仿宋_GB2312">）。演绎法从一个初始的事实出发，不断地应用规则得出结论（或执行指定的动作）。而归纳法则是根据假设，不断地寻找符合假设的事实。</span>Rete<span style="font-family: 仿宋_GB2312">算法是目前效率最高的一个</span>Forward-Chaining<span style="font-family: 仿宋_GB2312">推理算法，许多</span>Java<span style="font-family: 仿宋_GB2312">规则引擎都是基于</span>Rete<span style="font-family: 仿宋_GB2312">算法来进行推理计算的。</span></p>
<p style="margin-left: 60.75pt; text-indent: -21pt"><span style="font-family: Wingdings">l&nbsp;</span><strong><span style="font-family: 仿宋_GB2312">正向推理：</span></strong></p>
<p style="margin-left: 60.75pt; text-indent: 0cm"><strong>&nbsp;</strong></p>
<p style="margin-left: 15.6pt"><span style="font-family: 仿宋_GB2312">正向推理图形如下：</span></p>
<p style="margin-left: 19.85pt; text-indent: 19.85pt"><span style="font-family: 仿宋_GB2312">正向推理引擎的推理步骤如下：</span></p>
<p style="margin-left: 63pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">将初始数据（</span>fact<span style="font-family: 仿宋_GB2312">）输入</span>Working Memory<span style="font-family: 仿宋_GB2312">。</span></p>
<p style="margin-left: 63pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">使用</span>Pattern Matcher<span style="font-family: 仿宋_GB2312">比较规则库（</span>rule base<span style="font-family: 仿宋_GB2312">）中的规则（</span>rule<span style="font-family: 仿宋_GB2312">）和数据（</span>fact<span style="font-family: 仿宋_GB2312">）。</span></p>
<p style="margin-left: 63pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">如果执行规则存在冲突（</span>conflict<span style="font-family: 仿宋_GB2312">），即同时激活了多个规则，将冲突的规则放入冲突集合。</span></p>
<p style="margin-left: 63pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">解决冲突，将激活的规则按顺序放入</span>Agenda<span style="font-family: 仿宋_GB2312">。</span></p>
<p style="margin-left: 63pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">使用执行引擎执行</span>Agenda<span style="font-family: 仿宋_GB2312">中的规则。重复步骤</span>2<span style="font-family: 仿宋_GB2312">至</span>5<span style="font-family: 仿宋_GB2312">，直到执行完毕所有</span>Agenda<span style="font-family: 仿宋_GB2312">中的规则。</span></p>
<p style="margin-left: 63pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">直到得出最终的结果为止</span></p>
<p style="margin-left: 60.75pt; text-indent: -21pt"><span style="font-family: Wingdings">l&nbsp;</span><strong><span style="font-family: 仿宋_GB2312">反向推理：</span></strong></p>
<p style="margin-left: 60.75pt; text-indent: 0cm"><strong>&nbsp;</strong></p>
<p style="margin-left: 60.75pt; text-indent: 0cm"><span style="font-family: 仿宋_GB2312">反向推理是目标驱动的推理方式。从目标出发，找出所有能满足该目</span></p>
<p><span style="font-family: 仿宋_GB2312">标的子目标。这样一直推导下去，直到所有的子目标都已经满足为止。</span></p>
<h2><span style="font-family: 宋体">1.2</span>Java<span style="font-family: 仿宋_GB2312">规则引擎</span></h2>
<p>Java<span style="font-family: 仿宋_GB2312">规则引擎是一种嵌入在</span>Java<span style="font-family: 仿宋_GB2312">程序中的组件，它的任务是把当前提交给引擎的</span>Java<span style="font-family: 仿宋_GB2312">数据对象与加载在引擎中的业务规则进行测试和比对，激活那些符合当前数据状态下的业务规则，根据业务规则中声明的执行逻辑，触发应用程序中对应的操作。</span></p>
<p><span style="font-family: 仿宋_GB2312">一般来说，一条规则的形式如下：</span></p>
<p>when</p>
<p>&nbsp;&nbsp;&nbsp; &lt;conditions&gt;</p>
<p>then</p>
<p>&nbsp;&nbsp;&nbsp; &lt;actions&gt;</p>
<p><span style="font-family: 仿宋_GB2312">也就是说，当</span>conditions<span style="font-family: 仿宋_GB2312">成立的话，就做下面的</span>actions<span style="font-family: 仿宋_GB2312">。其中</span>actions<span style="font-family: 仿宋_GB2312">可以为生成新的事实、或者做其他动作，比如，发送</span>email<span style="font-family: 仿宋_GB2312">通知、执行一些本地任务等等。</span></p>
<h2>1.3<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </span>JAVA<span style="font-family: 仿宋_GB2312">规则引擎的优点</span></h2>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">声明式编程</span></p>
<p style="margin-left: 45.1pt; text-indent: 0cm"><span style="font-family: 仿宋_GB2312">声明式编程，规则引擎让我们直到&#8220;做什么&#8221;，而不用直到&#8220;怎么做&#8221;。我们只要把一系列规则表示出来后。具体的推理动作就交给规则引擎来处理。</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">逻辑和数据分开</span></p>
<p style="margin-left: 45.1pt; text-indent: 0cm"><span style="font-family: 仿宋_GB2312">将可变的业务逻辑和数据分开。虽然，这违背了面向对象原则。面向对象强调数据和业务逻辑耦合。但是，对于一些易变而复杂的业务规则。如果散步在程序的各个地方、各个层次。那么一旦业务规则更改的话，就会出现&#8220;牵一发而动全身&#8221;的局面。因此，将可变的业务逻辑独立出来管理，将有助于后面的业务变更。</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">性能</span></p>
<p style="margin-left: 45.1pt; text-indent: 0cm">Rete<span style="font-family: 仿宋_GB2312">算法的性能比较高。</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">知识集中表示</span></p>
<p style="margin-left: 59.55pt; text-indent: 0cm"><span style="font-family: 仿宋_GB2312">通过使用规则，我们把规则集中存放起来，从而使系统知识能够集中表示。</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">可读性</span></p>
<p style="margin-left: 59.55pt; text-indent: 0cm"><span style="font-family: 仿宋_GB2312">规则的可读性比较高。对于熟悉业务规则。但不会程序开发的业务专家，只要熟悉规则的标示，也可以编写和修改业务规则。</span></p>
<h2>1.4<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </span><span style="font-family: 仿宋_GB2312">使用</span>JAVA<span style="font-family: 仿宋_GB2312">规则系统的场合</span></h2>
<p><span style="font-family: 仿宋_GB2312">那么，在那些场合下适合应用</span>JAVA<span style="font-family: 仿宋_GB2312">规则系统呢？总而言之，可以用一句话来概括：当用传统的程序开发，无法得到一种优雅的解决方法的时候，就可以考虑使用规则系统。如下的一些场合：</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">用传统的代码开发比较复杂、繁琐</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">问题虽然不复杂，但是用传统的代码开发比较脆弱，也就是经常修改</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">没有优雅的算法</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">业务规则频繁改变</span></p>
<p style="margin-left: 45.1pt; text-indent: -21pt"><span style="font-family: Wingdings">n&nbsp;</span><span style="font-family: 仿宋_GB2312">有很多业务专家、不懂技术开发</span></p>
<h2>1.5<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp; </span><span style="font-family: 仿宋_GB2312">不适合使用</span>JAVA<span style="font-family: 仿宋_GB2312">规则系统场合</span></h2>
<p><span style="font-family: 仿宋_GB2312">虽然规则系统看起来比较不错，但是并不是任何地方都可以使用规则系统。很多简单、固定的业务系统，可以不用使用规则系统。规则系统也不能用来作为标示重要的业务流程、不能用来作为工作流引擎。</span></p>
<p><span style="font-family: 仿宋_GB2312">有很多程序员把</span>JAVA<span style="font-family: 仿宋_GB2312">规则系统当成是一种动态修改配置。也就是把一部分代码逻辑抽取到外面，统一存放起来。这样，当一些配置修改的话，通过修改规则，就能修改代码的一部分逻辑。如果把</span>JAVA<span style="font-family: 仿宋_GB2312">规则仅仅用在这个场合下的话，可以考虑采用脚本引擎。比如</span>BeanShell<span style="font-family: 仿宋_GB2312">、</span>JEXL<span style="font-family: 仿宋_GB2312">、</span>Groovy<span style="font-family: 仿宋_GB2312">等等。</span></p>
<img src ="http://www.blogjava.net/jspark/aggbug/237071.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2008-10-28 12:15 <a href="http://www.blogjava.net/jspark/archive/2008/10/28/237071.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>安装SUN ONE APPSERVER8.1以及部署应用所碰到的问题</title><link>http://www.blogjava.net/jspark/archive/2006/11/29/84348.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Wed, 29 Nov 2006 06:42:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2006/11/29/84348.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/84348.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2006/11/29/84348.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/84348.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/84348.html</trackback:ping><description><![CDATA[<p><font size=2></p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">grant&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.lang.RuntimePermission&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">loadLibrary.*</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.lang.RuntimePermission&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">queuePrintJob</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.lang.RuntimePermission&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">setContextClassLoader</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.lang.RuntimePermission&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">getProtectionDomain</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.lang.reflect.ReflectPermission&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">suppressAccessChecks</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br>&nbsp;&nbsp;&nbsp;&nbsp;};<br><br>grant&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.util.PropertyPermission&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;,&nbsp;&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;read,write&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;;<br><br>};&nbsp;&nbsp;<br></span></div>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 最近一个项目需要用到SUN ONE APPSERVER8.1，本人在WINDOWS SERVER 2003中安装，碰到一些问题，不过比较幸运的是都解决了，下面大概描述一下个人碰到的问题，期望能给别人带来帮助</font> </p>
<p><font size=2>&nbsp;&nbsp; 一、DNS服务器问题<br>&nbsp;&nbsp;&nbsp; 安装SUN ONE APPSERVER8.1必须要在服务器上安装，而且必须要将该服务器设置为DNS服务器。关于WINDOWS SERVER 2003<br>&nbsp;&nbsp;&nbsp; 如何设置DNS服务器，网上很多资料，可以查阅<br></font><font size=2><br>&nbsp;&nbsp; 二、文件系统权限访问问题<br>&nbsp;也许SUN ONE APPSERVER8.1服务器在文件访问方面控制比较严格，如果按照默认安装上去的系统。对于一些文件夹、文件读取是会有一些控制的。比如说，当将应用部署上去，然后访问应用，会抛出SecurityException。这是因为需要编译jsp页面，生成class文件，由于没有写权限，所以会出错。解决的方法是为SUN ONE APPSERVER增加文件访问权限。修改方法如下：<br>&nbsp;找到安装路径，下面以本人的安装路径为例子：<br>&nbsp;c\sunjes\ApplicationServer\domains\domain1\config<br>&nbsp;该目录下面有一个文件叫server.policy，打开该页面，可以看到里面是一些关于文件访问权限的例子<br></font></p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font size=2><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.blogjava.net/Images/dot.gif"><br></span><span style="COLOR: #008000">//</span> <span style="COLOR: #008000">&nbsp;Core&nbsp;server&nbsp;classes&nbsp;get&nbsp;all&nbsp;permissions&nbsp;by&nbsp;default</span> </font><span style="COLOR: #008000"><br></span><font size=2><span style="COLOR: #000000">grant&nbsp;codeBase&nbsp;</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">file:${com.sun.aas.installRoot}/lib/-</span> <span style="COLOR: #000000">"</span> </font><font size=2><span style="COLOR: #000000">&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.security.AllPermission;<br>};<br>&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.blogjava.net/Images/dot.gif"><br>&nbsp;&nbsp;&nbsp;&nbsp;下面为文件路径增加访问权限，个人把整个c盘设置为可读可写，如下<br><br>&nbsp;&nbsp;&nbsp;&nbsp;grant&nbsp;codeBase&nbsp;</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">file:c:/-</span> <span style="COLOR: #000000">"</span> </font><font size=2><span style="COLOR: #000000">&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.security.AllPermission;<br>};<br><br>grant&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;permission&nbsp;java.io.FilePermission&nbsp;</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">c:/-</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,&nbsp;</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">read,write,execute,delete</span> <span style="COLOR: #000000">"</span> </font><span style="COLOR: #000000"><font size=2>;<br><br>};&nbsp;</font> </span></div>
<p><br><font size=2>&nbsp;编辑完毕，保存，重启服务器，OK，该问题解决。 :)</font> <br></p>
<p><font size=2>&nbsp; 三、其他几个权限问题：<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 编辑以上问题后，重新自动，可能还会发现以下几个异常，比如 permission java.util.PropertyPermission&nbsp;&nbsp; "*" ,&nbsp; " read,write " ;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 因此，分别加上如下几个权限设置即可<br>&nbsp;&nbsp;&nbsp; </p>
<p><br><br>&nbsp; 四、ORACLE10.2.0.1驱动问题<br>&nbsp;本人部署的应用是spring+hb架构，里面用到blog/clob大字段处理，因此驱动程序用最新的驱动程序10g，版本为10.2.0.1。在部署到SUN ONE APPSERVER8.1时，也抛出类访问异常，异常信息是：oracle.sql is sealed。没办法，上网搜索了一下，发现有很多人也遇过这个情况。主要是oracle10g.jar里面的Meta-inf定义，增加了sealed属性。打开该文件MANIFEST.MF，内容如下：<br>&nbsp;</font> </p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font size=2><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;Manifest</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">Version:&nbsp;</span> <span style="COLOR: #000000">1.0</span> </font><span style="COLOR: #000000"><br><font size=2>Specification</font> </span><font size=2><span style="COLOR: #000000">-</span> <span style="COLOR: #000000">Title:&nbsp;&nbsp;&nbsp;&nbsp;Oracle&nbsp;JDBC&nbsp;driver&nbsp;classes&nbsp;</span> <span style="COLOR: #0000ff">for</span> </font><font size=2><span style="COLOR: #000000">&nbsp;use&nbsp;with&nbsp;JDK14<br>Created</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">By:&nbsp;</span> <span style="COLOR: #000000">1.4</span> </font><font size=2><span style="COLOR: #000000">.2_08&nbsp;(Sun&nbsp;Microsystems&nbsp;Inc.)<br>sealed:</span> <span style="COLOR: #0000ff">true</span> </font><span style="COLOR: #000000"><br><font size=2>Implementation</font> </span><span style="COLOR: #000000"><font size=2>-</font> </span><font size=2><span style="COLOR: #000000">Title:&nbsp;&nbsp;&nbsp;ojdbc14.jar<br>Specification</span> <span style="COLOR: #000000">-</span> </font><font size=2><span style="COLOR: #000000">Vendor:&nbsp;&nbsp;&nbsp;Oracle&nbsp;Corporation<br>Specification</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">Version:&nbsp;&nbsp;Oracle&nbsp;JDBC&nbsp;Driver&nbsp;version&nbsp;</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">&nbsp;</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">10.2.0.1.0</span> <span style="COLOR: #000000">"</span> </font><span style="COLOR: #000000"><br><font size=2>Implementation</font> </span><font size=2><span style="COLOR: #000000">-</span> <span style="COLOR: #000000">Version:&nbsp;Oracle&nbsp;JDBC&nbsp;Driver&nbsp;version&nbsp;</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">&nbsp;</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">10.2.0.1.0</span> <span style="COLOR: #000000">"</span> </font><span style="COLOR: #000000"><br><font size=2>Implementation</font> </span><span style="COLOR: #000000"><font size=2>-</font> </span><font size=2><span style="COLOR: #000000">Vendor:&nbsp;&nbsp;Oracle&nbsp;Corporation<br>Implementation</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">Time:&nbsp;&nbsp;&nbsp;&nbsp;Wed&nbsp;Jun&nbsp;</span> <span style="COLOR: #000000">22</span> <span style="COLOR: #000000">&nbsp;</span> <span style="COLOR: #000000">18</span> <span style="COLOR: #000000">:</span> <span style="COLOR: #000000">55</span> <span style="COLOR: #000000">:</span> <span style="COLOR: #000000">48</span> <span style="COLOR: #000000">&nbsp;</span> <span style="COLOR: #000000">2005</span> </font></div>
<p><font size=2>&nbsp;关于sealed属性网上也有<br>&nbsp;很多资料介绍，有兴趣的网友可以参阅一下。网上同行的解决方法是下载10g，低点的版本。本人的解决方法是修改一下里面的MANIFEST.MF文件，把sealed:true去掉即可。</font> </p>
<p><br><font size=2>&nbsp;四、包版本不兼容。<br>&nbsp;解决完以上几个问题后，重新启动，本以为万事大吉，很不幸运的是，再次抛出异常：<br>&nbsp;ClassNotFoundException: org.hibernate.hql.ast.HqlToken。同样，上网搜索了一下，发现是hibernate的antlr.jar和SUN ONE APPSERVER的antlr.jar存在冲突。hibernate3.0版本用<br>&nbsp;的antlr.jar包版本是2.7.5，比SUN ONE APPSERVER的高。以前在weblogic部署应用时，也出现过类似的问题。由于这些服务器会优先装载自己的类，因此会出现一些问题。解决方法是把hibernate下较高版本的antlr.jar放在classpath的前面。在SUN ONE APPSERVER<br>&nbsp;下最快捷的方式就是将antlr-2.7.5H3.jar拷贝到ApplicationServer\lib目录下面即可</font> </p>
<p><font size=2>&nbsp;解决完以上几个问题后，再次重启，访问，OK，一切正常！好有成就感 :)</font> </p>
<img src ="http://www.blogjava.net/jspark/aggbug/84348.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2006-11-29 14:42 <a href="http://www.blogjava.net/jspark/archive/2006/11/29/84348.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(ZT)Sun HotSpot 1.4.1 JVM堆大小的调整</title><link>http://www.blogjava.net/jspark/archive/2006/11/28/84008.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Tue, 28 Nov 2006 03:58:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2006/11/28/84008.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/84008.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2006/11/28/84008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/84008.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/84008.html</trackback:ping><description><![CDATA[
		<strong>Sun HotSpot 1.4.1 JVM堆大小的调整<br /></strong>    <br />    Sun HotSpot 1.4.1使用分代收集器，它把堆分为三个主要的域：新域、旧域以及永久域。Jvm生成的所有新对象放在新域中。一旦对象经历了一定数量的垃圾收集循环后，便获得使用期并进入旧域。在永久域中jvm则存储class和method对象。就配置而言，永久域是一个独立域并且不认为是堆的一部分。<br /><br />    下面介绍如何控制这些域的大小。可使用-Xms和-Xmx 控制整个堆的原始大小或最大值。<br />    下面的命令是把初始大小设置为128M：<br />    <span style="COLOR: blue">java –Xms128m</span><br />     –Xmx256m为控制新域的大小，可使用-XX:NewRatio设置新域在堆中所占的比例。<br /><br />   下面的命令把整个堆设置成128m，新域比率设置成3，即新域与旧域比例为1：3，新域为堆的1/4或32M：<br />   <span style="COLOR: blue">java –Xms128m –Xmx128m</span><br />    –XX:NewRatio =3可使用-XX:NewSize和-XX:MaxNewsize设置新域的初始值和最大值。<br /><br />   下面的命令把新域的初始值和最大值设置成64m: <br />     <span style="COLOR: blue">java –Xms256m –Xmx256m –Xmn64m</span><br />   永久域默认大小为4m。运行程序时，jvm会调整永久域的大小以满足需要。每次调整时，jvm会对堆进行一次完全的垃圾收集。<br /><br />   使用-XX:MaxPerSize标志来增加永久域搭大小。在WebLogic Server应用程序加载较多类时，经常需要增加永久域的最大值。当jvm加载类时，永久域中的对象急剧增加，从而使jvm不断调整永久域大小。为了避免调整，可使用-XX:PerSize标志设置初始值。<br />   下面把永久域初始值设置成32m，最大值设置成64m。<br />    <span style="COLOR: blue">java -Xms512m -Xmx512m -Xmn128m -XX:PermSize=32m -XX:MaxPermSize=64m</span><br /><br />    默认状态下，HotSpot在新域中使用复制收集器。该域一般分为三个部分。第一部分为Eden，用于生成新的对象。另两部分称为救助空间，当Eden充满时，收集器停止应用程序，把所有可到达对象复制到当前的from救助空间，一旦当前的from救助空间充满，收集器则把可到达对象复制到当前的to救助空间。From和to救助空间互换角色。维持活动的对象将在救助空间不断复制，直到它们获得使用期并转入旧域。使用-XX:SurvivorRatio可控制新域子空间的大小。<br /><br />    同NewRation一样，SurvivorRation规定某救助域与Eden空间的比值。比如，以下命令把新域设置成64m，Eden占32m，每个救助域各占16m：<br />    <span style="COLOR: blue">java -Xms256m -Xmx256m -Xmn64m -XX:SurvivorRation =2</span><br /><br />    如前所述，默认状态下HotSpot对新域使用复制收集器，对旧域使用标记－清除－压缩收集器。在新域中使用复制收集器有很多意义，因为应用程序生成的大部分对象是短寿命的。理想状态下，所有过渡对象在移出Eden空间时将被收集。如果能够这样的话，并且移出Eden空间的对象是长寿命的，那么理论上可以立即把它们移进旧域，避免在救助空间反复复制。但是，应用程序不能适合这种理想状态，因为它们有一小部分中长寿命的对象。最好是保持这些中长寿命的对象并放在新域中，因为复制小部分的对象总比压缩旧域廉价。为控制新域中对象的复制，可用-XX:TargetSurvivorRatio控制救助空间的比例（该值是设置救助空间的使用比例。如救助空间位1M，该值50表示可用500K）。该值是一个百分比，默认值是50。当较大的堆栈使用较低的sruvivorratio时，应增加该值到80至90，以更好利用救助空间。用-XX:maxtenuring threshold可控制上限。<br /><br />   为放置所有的复制全部发生以及希望对象从eden扩展到旧域，可以把MaxTenuring Threshold设置成0。设置完成后，实际上就不再使用救助空间了，因此应把SurvivorRatio设成最大值以最大化Eden空间，设置如下：<br />   <span style="COLOR: blue">java … -XX:MaxTenuringThreshold=0 –XX:SurvivorRatio＝50000 …</span><br /><img src ="http://www.blogjava.net/jspark/aggbug/84008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2006-11-28 11:58 <a href="http://www.blogjava.net/jspark/archive/2006/11/28/84008.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(ZT)Submit form into window.opener</title><link>http://www.blogjava.net/jspark/archive/2006/11/22/82789.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Wed, 22 Nov 2006 07:39:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2006/11/22/82789.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/82789.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2006/11/22/82789.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/82789.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/82789.html</trackback:ping><description><![CDATA[
		<font face="Verdana" size="2">Assigning the <b class="mo">target</b> property requires the <i class="mo">name</i> of a window not the window itself. </font>
		<p>
				<font class="mo" face="Verdana" color="#000000" size="2">Wecould try something like </font>
		</p>
		<p>
				<font class="mo" face="verdana" color="#000000" size="2">window.opener.name="opener728"; <br />form.target="opener728"; </font>
		</p>
		<p>
				<font class="mo" face="verdana" color="#000000" size="2">however, I suspect the <b class="mo">window.name</b> property is read-only. </font>
		</p>
		<p>
				<font class="mo" face="verdana" color="#000000" size="2">Alternatively, if We are certain that the opener already has a name then this might work </font>
		</p>
		<p>
				<font class="mo" face="verdana" color="#000000" size="2">form.target=window.opener.name; </font>
		</p>
		<p>
				<font class="mo" face="verdana" color="#000000" size="2">It's also possible that browsers assign unique names to otherwise unnamed windows, so the above would always work - I've never checked this. </font>
		</p>
		<p>
				<font class="mo" face="verdana" color="#000000" size="2">
						<!-- /post -->
				</font>
				<font face="Verdana" size="2">
				</font>
				<br />
		</p>
<img src ="http://www.blogjava.net/jspark/aggbug/82789.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2006-11-22 15:39 <a href="http://www.blogjava.net/jspark/archive/2006/11/22/82789.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>csv reader的使用</title><link>http://www.blogjava.net/jspark/archive/2006/11/07/79566.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Tue, 07 Nov 2006 04:05:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2006/11/07/79566.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/79566.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2006/11/07/79566.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/79566.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/79566.html</trackback:ping><description><![CDATA[
		<p>今天从网上找了一个读写csv格式的开源程序，还挺好用的。<br /><br />下面是一个读取例子：<br /><br />源文件格式：</p>
		<p> ProductID,ProductName,SupplierID,CategoryID,QuantityPerUnit,UnitPrice,UnitsInStock,UnitsOnOrder,ReorderLevel,Discontinued<br /> 1,Chai,1,1,10 boxes x 20 bags,18,39,0,10,FALSE<br /> 2,Chang,1,1,24 - 12 oz bottles,19,17,40,25,FALSE<br /><br /> 下面读取程序</p>
		<p> </p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000"> CsvReader reader </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000"> CsvReader(</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">products.csv</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> reader.readHeaders();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span>
				<span style="COLOR: #0000ff">while</span>
				<span style="COLOR: #000000"> (reader.readRecord())<br /><img id="Codehighlighter1_106_649_Open_Image" onclick="this.style.display='none'; Codehighlighter1_106_649_Open_Text.style.display='none'; Codehighlighter1_106_649_Closed_Image.style.display='inline'; Codehighlighter1_106_649_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_106_649_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_106_649_Closed_Text.style.display='none'; Codehighlighter1_106_649_Open_Image.style.display='inline'; Codehighlighter1_106_649_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span>
				<span id="Codehighlighter1_106_649_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
						<img src="http://www.blogjava.net/images/dot.gif" />
				</span>
				<span id="Codehighlighter1_106_649_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String productID </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">ProductID</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String productName </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">ProductName</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String supplierID </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">SupplierID</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String categoryID </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">CategoryID</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String quantityPerUnit </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">QuantityPerUnit</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String unitPrice </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">UnitPrice</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String unitsInStock </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">UnitsInStock</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String unitsOnOrder </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">UnitsOnOrder</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String reorderLevel </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">ReorderLevel</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  String discontinued </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> reader.get(</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">Discontinued</span>
						<span style="COLOR: #000000">"</span>
						<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />  </span>
						<span style="COLOR: #008000">//</span>
						<span style="COLOR: #008000"> perform program logic here</span>
						<span style="COLOR: #008000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> }</span>
				</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> reader.close();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
		</div>
		<p>
				<br />
				<br />
				<br />写CSV例子：<br /><br /> CsvWriter writer = new CsvWriter(new FileWriter(new File("c:\\1.csv")),',');<br />  writer.write("aa");<br />  writer.write("bb");<br />  writer.write("cc");<br />  writer.endRecord();<br />  writer.write("1");<br />  writer.write("2");<br />  writer.write("3");<br />  writer.close();<br /><br /></p>
<img src ="http://www.blogjava.net/jspark/aggbug/79566.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2006-11-07 12:05 <a href="http://www.blogjava.net/jspark/archive/2006/11/07/79566.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>spring+hibernate的clob大字段处理（转载于javaeye论坛）</title><link>http://www.blogjava.net/jspark/archive/2006/08/28/66140.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Mon, 28 Aug 2006 03:58:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2006/08/28/66140.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/66140.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2006/08/28/66140.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/66140.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/66140.html</trackback:ping><description><![CDATA[
		<p>
		</p>
		<table cellspacing="1" cellpadding="3" width="90%" align="center" border="0">
				<tbody>
						<tr>
								<td>
										<span class="genmed">在spring中如何处理oracle大字段 <br /><br />在spring中采用OracleLobHandler来处理oracle大字段（包括clob和blob），则在程序中不需要引用oracle的特殊类，从而能够保证支持我们的代码支持多数据库。 <br /><br />1、首先数据表中的clob类型对应java持久化类的String类型；而blob类型对应byte[]类型 <br />2、定义hibernate标签时，持久化类中对应clob类型的属性的hibernate type应为org.springframework.orm.hibernate.support.ClobStringType；而对应blob类型的属性的hibernate type应为org.springframework.orm.hibernate.support.BlobByteArrayType。 <br />3、以后访问这些对应clob和blob类型的属性时，按普通属性处理，不需要特别编码。 <br /><br /><strong>java代码: </strong></span>
								</td>
						</tr>
						<tr>
								<td class="code">
										<div style="FONT-FAMILY: 'Courier New', Courier, monospace">
												<br />
												<br />
												<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
														<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">bean </span>
														<span style="COLOR: #ff0000">id</span>
														<span style="COLOR: #0000ff">="mySessionFactory2"</span>
														<span style="COLOR: #ff0000"> class</span>
														<span style="COLOR: #0000ff">="org.springframework.orm.hibernate.LocalSessionFactoryBean"</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        </span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">property </span>
														<span style="COLOR: #ff0000">name</span>
														<span style="COLOR: #0000ff">="dataSource"</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />                </span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">ref </span>
														<span style="COLOR: #ff0000">bean</span>
														<span style="COLOR: #0000ff">="myDataSource2"</span>
														<span style="COLOR: #0000ff">/&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span>
														<span style="COLOR: #0000ff">&lt;/</span>
														<span style="COLOR: #800000">property</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">property </span>
														<span style="COLOR: #ff0000">name</span>
														<span style="COLOR: #0000ff">="lobHandler"</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        </span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">ref </span>
														<span style="COLOR: #ff0000">bean</span>
														<span style="COLOR: #0000ff">="oracleLobHandle"</span>
														<span style="COLOR: #0000ff">/&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span>
														<span style="COLOR: #0000ff">&lt;/</span>
														<span style="COLOR: #800000">property</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000">  <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
														<span style="COLOR: #0000ff">&lt;/</span>
														<span style="COLOR: #800000">bean</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">bean </span>
														<span style="COLOR: #ff0000">id</span>
														<span style="COLOR: #0000ff">="nativeJdbcExtractor"</span>
														<span style="COLOR: #ff0000"> class</span>
														<span style="COLOR: #0000ff">="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"</span>
														<span style="COLOR: #0000ff">/&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">bean </span>
														<span style="COLOR: #ff0000">id</span>
														<span style="COLOR: #0000ff">="oracleLobHandle"</span>
														<span style="COLOR: #ff0000"> class</span>
														<span style="COLOR: #0000ff">="org.springframework.jdbc.support.lob.OracleLobHandler"</span>
														<span style="COLOR: #ff0000"> Lazy-init</span>
														<span style="COLOR: #0000ff">="true"</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">property </span>
														<span style="COLOR: #ff0000">name</span>
														<span style="COLOR: #0000ff">="nativeJdbcExtractor"</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
														<span style="COLOR: #0000ff">&lt;</span>
														<span style="COLOR: #800000">ref </span>
														<span style="COLOR: #ff0000">local</span>
														<span style="COLOR: #0000ff">="nativejdbcExtractor"</span>
														<span style="COLOR: #0000ff">/&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
														<span style="COLOR: #0000ff">&lt;/</span>
														<span style="COLOR: #800000">property</span>
														<span style="COLOR: #0000ff">&gt;</span>
														<span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
														<span style="COLOR: #0000ff">&lt;/</span>
														<span style="COLOR: #800000">bean</span>
														<span style="COLOR: #0000ff">&gt;</span>
												</div>
										</div>
										<br />
								</td>
						</tr>
				</tbody>
		</table>
		<br />Spring为处理数据库Lob字段，特别提供了LobHandler接口。在操作Oracle RDBMS过程中，由于Oracle JDBC Driver实现的问题，应用必须采用Oracle原生的数据库连接（比如，oracle.jdbc.OracleConnection）、LOB原生实现（比如，oracle.sql.BLOB、oracle.sql.CLOB）。因此，LobHandler接口存在上述两种实现。简而言之，为操作Oracle数据库，必须使用OracleLobHandler实现。如果操作其他RDBMS类型，则使用DefaultLobHandler。NativeJdbcExtractor是个接口，通过它能够抽象各种连接池。另外Spring还提供两个接口存取Blob，LobCreator及LobHandler <br /><img src ="http://www.blogjava.net/jspark/aggbug/66140.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2006-08-28 11:58 <a href="http://www.blogjava.net/jspark/archive/2006/08/28/66140.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java政则表达式的子序列（group）</title><link>http://www.blogjava.net/jspark/archive/2006/08/15/63687.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Tue, 15 Aug 2006 07:30:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2006/08/15/63687.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/63687.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2006/08/15/63687.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/63687.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/63687.html</trackback:ping><description><![CDATA[
		<p>   jdk提供的正则表达式是非常强大的，只要用过正则表达式的程序员应该是为其功能叹为观止。不过，正则表达式中的一个group概念相信应该不多人熟悉。</p>
		<p>    正则表达式中的group，主要是用来区分子序列的，所谓子序列是用()之内的表达式。下面以一段程序为例<br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">        String regex = "\\$\\{(I)(love)(java)\\}";<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        System.out.println(Pattern.compile(regex).matcher("${Ilovejava}P)").groupCount());</span>
		</div>
		<br /> 运行上面的代码段，结果为：3<br /> 其中(I)为一个组， (love)为一个组，(java)为一个组。<br /><br />  <br />  也许有人觉得这只是一个小功能，但是正则表达式的group，还有一个更加强大的地方就是在String.replaceAll方法中。<br />  public <a title="java.lang 中的类" href="mk:@MSITStore:C:\Documents%20and%20Settings\hushaofeng\桌面\JAVA5.0API_CN.CHM::/java/lang/String.html">String</a><b>replaceAll</b>(<a title="java.lang 中的类" href="mk:@MSITStore:C:\Documents%20and%20Settings\hushaofeng\桌面\JAVA5.0API_CN.CHM::/java/lang/String.html">String</a> regex,<br />                         <a title="java.lang 中的类" href="mk:@MSITStore:C:\Documents%20and%20Settings\hushaofeng\桌面\JAVA5.0API_CN.CHM::/java/lang/String.html">String</a> replacement)<br /><br /> 其中第一个参数当然是政则表达式，第二个一般是普通的文本；但是第二个参数可以应用group的地方，这个功能用在一些场合是非常方便的。<br />      比如，下面这个例子  &lt;driverClass&gt;${driverClass}&lt;/driverClass&gt;，要将${}去掉，即将这个例子替换成&lt;driverClass&gt;driverClass&lt;/driverClass&gt;,可以用下面的代码来替换。例如<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">        String text = "</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">driverClass</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">${driverClass}</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">driverClass</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">";<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        String result = replaceStr(text,"\\$\\{(driverClass)\\}","$1");<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />        System.out.println("result is:"+result);</span></div><br />   运行结果：result is:&lt;driverClass&gt;driverClass&lt;/driverClass&gt;<br />  从上面可以看出，$1就是正则表达式中匹配的第一个序列，同样$2...表示第几个序列。如果$index中的index超出了表达式中子序列的个数的话，将抛出异常信息。 $0表示整个正则表达式。<img src ="http://www.blogjava.net/jspark/aggbug/63687.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2006-08-15 15:30 <a href="http://www.blogjava.net/jspark/archive/2006/08/15/63687.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>tomcat5.0与tomcat5.5的数据库连接池jndi配置区别</title><link>http://www.blogjava.net/jspark/archive/2006/08/11/62989.html</link><dc:creator>jspark</dc:creator><author>jspark</author><pubDate>Fri, 11 Aug 2006 06:03:00 GMT</pubDate><guid>http://www.blogjava.net/jspark/archive/2006/08/11/62989.html</guid><wfw:comment>http://www.blogjava.net/jspark/comments/62989.html</wfw:comment><comments>http://www.blogjava.net/jspark/archive/2006/08/11/62989.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/jspark/comments/commentRss/62989.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jspark/services/trackbacks/62989.html</trackback:ping><description><![CDATA[在tomcat5.5版本以前，可以说jndi配置相对是比较复杂的，而且据网友说用tomcat5.0的控制台配置数据库连接池经常有问题，而且文档写得又不详细。<br /><br />tomcat5.5出来后，jndi的配置方法是大大地节省，而且很简洁，个人觉得比以前的版本好很多。这里大概给出一个配置例子。tomcat数据库连接池jndi配置有两种，一种是全局的，一种是context的，下面主要是讲全局的，并且以一个实例jdbc/byisdb为例子<br />   <br />一、tomcat5.0配置方法<br /><br />1、首先在server.xml里面配置，找到下面的配置<br />  &lt;!-- Global JNDI resources --&gt;<br />  &lt;GlobalNamingResources&gt;<br /> &lt;/GlobalNamingResources&gt;<br /><br />2、在里面增加一个Resource<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">Resource name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">jdbc/byisdb</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />               auth</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Container</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />               type</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">javax.sql.DataSource</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">/&gt;</span></div><br /><br />3、在下面增加属性<br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">  </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">ResourceParams name</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">jdbc/byisdb</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">factory</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">org.apache.commons.dbcp.BasicDataSourceFactory</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;!--</span><span style="COLOR: #000000"> Maximum number of dB connections in pool. Make sure you<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         configure your mysqld max_connections large enough to handle<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         all of your db connections. Set to </span><span style="COLOR: #000000">0</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> no limit.<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span><span style="COLOR: #000000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">maxActive</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">100</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;!--</span><span style="COLOR: #000000"> Maximum number of idle dB connections to retain in pool.<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         Set to </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> no limit.  See also the DBCP documentation on </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         and the minEvictableIdleTimeMillis configuration parameter.<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span><span style="COLOR: #000000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">maxIdle</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">30</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;!--</span><span style="COLOR: #000000"> Maximum time to wait </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> a dB connection to become available<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         in ms, in </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000"> example </span><span style="COLOR: #000000">10</span><span style="COLOR: #000000"> seconds. An Exception is thrown </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000"> timeout is exceeded.  Set to </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000"> to wait indefinitely.<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span><span style="COLOR: #000000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">maxWait</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">10000</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;!--</span><span style="COLOR: #000000"> MySQL dB username and password </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> dB connections  </span><span style="COLOR: #000000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />     </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">username</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />     </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">una_oa</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />     </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">password</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />     </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">una_oa</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;!--</span><span style="COLOR: #000000"> Class name </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> the old mm.mysql JDBC driver </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> uncomment </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000"> entry and comment next<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> you want to use </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000"> driver </span><span style="COLOR: #000000">-</span><span style="COLOR: #000000"> we recommend using Connector</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">J though<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />       </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">driverClassName</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />       </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">org.gjt.mm.mysql.Driver</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />     </span><span style="COLOR: #000000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;!--</span><span style="COLOR: #000000"> Class name </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> the official MySQL Connector</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">J driver </span><span style="COLOR: #000000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />       </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">driverClassName</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />       </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">oracle.jdbc.driver.OracleDriver</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;!--</span><span style="COLOR: #000000"> The JDBC connection url </span><span style="COLOR: #0000ff">for</span><span style="COLOR: #000000"> connecting to your MySQL dB.<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         The autoReconnect</span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000"> argument to the url makes sure that the<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         mm.mysql JDBC Driver will automatically reconnect </span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000"> mysqld closed the<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         connection.  mysqld by </span><span style="COLOR: #0000ff">default</span><span style="COLOR: #000000"> closes idle connections after </span><span style="COLOR: #000000">8</span><span style="COLOR: #000000"> hours.<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />         </span><span style="COLOR: #000000">--&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">url</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">jdbc:oracle:thin:@</span><span style="COLOR: #000000">192.168</span><span style="COLOR: #000000">.</span><span style="COLOR: #000000">1.210</span><span style="COLOR: #000000">:</span><span style="COLOR: #000000">1521</span><span style="COLOR: #000000">:byisdb</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">value</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">parameter</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />  </span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">ResourceParams</span><span style="COLOR: #000000">&gt;</span></div><br />4、在你的应用的web.xml里面增加<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">resource</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">description</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">postgreSQL Datasource example</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">description</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">jdbc</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">byisdb</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">type</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">javax.sql.DataSource</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">type</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">auth</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">Container</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">auth</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">resource</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">&gt;</span></div><p>OK,到此配置完毕，可以用下面的几段代码进行测试<br /></p><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">Context initContext </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> InitialContext();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />Context envContext  </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> (Context)initContext.lookup(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">java:/comp/env</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />DataSource ds </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> (DataSource)envContext.lookup(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">jdbc/byisdb</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />Connection conn </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> ds.getConnection();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />out.println(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">conn is:</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">conn);</span></div><p>二、tomcat5.5配置<br /><br />1、打开conf/context.xml里面<br />  添加下面的配置<br /></p><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">Resource </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="jdbc/byisdb"</span><span style="COLOR: #ff0000"> auth</span><span style="COLOR: #0000ff">="Container"</span><span style="COLOR: #ff0000"> type</span><span style="COLOR: #0000ff">="javax.sql.DataSource"</span><span style="COLOR: #ff0000"> driverClassName</span><span style="COLOR: #0000ff">="oracle.jdbc.driver.OracleDriver"</span><span style="COLOR: #ff0000"> url</span><span style="COLOR: #0000ff">="jdbc:oracle:thin:@192.168.1.210:1521:byisdb"</span><span style="COLOR: #ff0000"> username</span><span style="COLOR: #0000ff">="una_oa"</span><span style="COLOR: #ff0000"> password</span><span style="COLOR: #0000ff">="una_oa"</span><span style="COLOR: #ff0000"> maxActive</span><span style="COLOR: #0000ff">="20"</span><span style="COLOR: #ff0000"> maxIdle</span><span style="COLOR: #0000ff">="10"</span><span style="COLOR: #ff0000"> maxWait</span><span style="COLOR: #0000ff">="10000"</span><span style="COLOR: #0000ff">/&gt;</span></div><p> </p><p>2在你的应用的web.xml里面增加<br /></p><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">resource</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">description</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">postgreSQL Datasource example</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">description</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">jdbc</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">byisdb</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">name</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">type</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">javax.sql.DataSource</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">type</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /> </span><span style="COLOR: #000000">&lt;</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">auth</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">Container</span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">res</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">auth</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">&lt;/</span><span style="COLOR: #000000">resource</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">ref</span><span style="COLOR: #000000">&gt;</span></div><br />同样，可以用上面的代码进行测试。<img src ="http://www.blogjava.net/jspark/aggbug/62989.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jspark/" target="_blank">jspark</a> 2006-08-11 14:03 <a href="http://www.blogjava.net/jspark/archive/2006/08/11/62989.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>