﻿<?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-学习园地</title><link>http://www.blogjava.net/qiubite520/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 16:43:47 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 16:43:47 GMT</pubDate><ttl>60</ttl><item><title>HttpClient入门</title><link>http://www.blogjava.net/qiubite520/archive/2015/03/30/423945.html</link><dc:creator>丘比特</dc:creator><author>丘比特</author><pubDate>Mon, 30 Mar 2015 02:01:00 GMT</pubDate><guid>http://www.blogjava.net/qiubite520/archive/2015/03/30/423945.html</guid><wfw:comment>http://www.blogjava.net/qiubite520/comments/423945.html</wfw:comment><comments>http://www.blogjava.net/qiubite520/archive/2015/03/30/423945.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qiubite520/comments/commentRss/423945.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qiubite520/services/trackbacks/423945.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: HttpClient入门HttpClient 是 Apache Jakarta Common 下的子项目，可以用来提供高效的、最新的、功能丰富的支持 HTTP 协议的客户端编程工具包，并且它支持 HTTP 协议最新的版本和建议。本文首先介绍 HTTPClient，然后根据作者实际工作经验给出了一些常见问题的解决方法。HttpClient简介HTTP ...&nbsp;&nbsp;<a href='http://www.blogjava.net/qiubite520/archive/2015/03/30/423945.html'>阅读全文</a><img src ="http://www.blogjava.net/qiubite520/aggbug/423945.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qiubite520/" target="_blank">丘比特</a> 2015-03-30 10:01 <a href="http://www.blogjava.net/qiubite520/archive/2015/03/30/423945.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>omcat7.0 和 websphere 7.0 服务器中Spring使用JNDI dataSource 的配置</title><link>http://www.blogjava.net/qiubite520/archive/2015/03/14/423462.html</link><dc:creator>丘比特</dc:creator><author>丘比特</author><pubDate>Sat, 14 Mar 2015 12:47:00 GMT</pubDate><guid>http://www.blogjava.net/qiubite520/archive/2015/03/14/423462.html</guid><wfw:comment>http://www.blogjava.net/qiubite520/comments/423462.html</wfw:comment><comments>http://www.blogjava.net/qiubite520/archive/2015/03/14/423462.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qiubite520/comments/commentRss/423462.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qiubite520/services/trackbacks/423462.html</trackback:ping><description><![CDATA[<h1 style="text-align: center; margin: 17pt 0cm 16.5pt" align="center"><font size="5"><span lang="EN-US"><font face="Times New Roman">Tomcat7.0 </font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">和</span><span lang="EN-US"><font face="Times New Roman"> websphere 7.0 </font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">服务器中</span><span lang="EN-US"><font face="Times New Roman">Spring</font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">使用</span><span lang="EN-US"><font face="Times New Roman">JNDI dataSource </font></span><span style="font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的</span></font><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">配置<span lang="EN-US"><o:p></o:p></span></span></font></h1>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">一、<span lang="EN-US">Tomcat </span>服务器中<span lang="EN-US">Spring </span>使用<span lang="EN-US">JNDI</span>数据源及配置<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">1. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">在<span lang="EN-US">TOMCAT_HOME</span>目录下<span lang="EN-US">conf</span>中的<span lang="EN-US">context.xml </span>文件中<span lang="EN-US"> &lt;Context&gt;</span>标签中加入<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;Resource name="jndids"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">auth="Container"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">type="javax.sql.DataSource"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">password="password"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">username="developer"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">driverClassName="oracle.jdbc.OracleDriver"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">url="jdbc:oracle:thin:@17.0.0.1:1521:orcl"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">maxActive="100"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">maxIdle="2"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">maxWait="5000"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">/&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">2. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">在<span lang="EN-US">cmis</span>工程的<span lang="EN-US">web.xml</span>中加入<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;resource-ref&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;description&gt;OracleDBConnection Pool&lt;/description&gt; &lt;res-ref-name&gt;<font size="4">jndids</font>&lt;/res-ref-name&gt; &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt; &lt;res-auth&gt;Container&lt;/res-auth&gt; &lt;/resource-ref&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">3. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">在<span lang="EN-US">Spring</span>的<span lang="EN-US"> applicationContext.xml </span>文件中配置<span lang="EN-US">dataSource<o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;bean id="dataSource"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">class="org.springframework.jndi.JndiObjectFactoryBean"&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;property name="jndiName"&gt; &lt;value&gt;java:comp/env/<font size="4">jndids</font>&lt;/value&gt; &lt;/property&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;/bean&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">二、<span lang="EN-US">Websphere</span>服务器中<span lang="EN-US">Spring </span>使用<span lang="EN-US">JNDI</span>数据源及配置<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">1. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">创建<span lang="EN-US">JDBC</span>提供者：<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">进入<span lang="EN-US">WebSphere</span>管理控制台后，点击&#8220;资源&#8221;<span lang="EN-US">?</span>&#8220;<span lang="EN-US">JDBC</span>&#8221;<span lang="EN-US">?</span>&#8220;<span lang="EN-US">JDBC</span>提供者&#8221;如下图，点击&#8220;新建&#8221;按钮，准备创建数据源。<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">a</span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">． 新建<span lang="EN-US">JDBC<o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">b</span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">． 指定驱动<span lang="EN-US">driver (</span>默认的路径可能不行<span lang="EN-US">,</span>我改成了绝对路径<span lang="EN-US">)<o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">2. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">创建数据源<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">a. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">进入数据源配置界面，点击&#8220;新建&#8221;按钮<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">b. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">选择刚才创建的<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">JDBC<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">c. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">输入<span lang="EN-US">URL<o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">d. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">设置安全性别名<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">如果已经创建了&#8220;组件管理的认证别名&#8221;和&#8220;容器管理的认证别名&#8221;，直接选择；如果没有创建点击&#8220;全局<span lang="EN-US"> J2C </span>认证别名&#8221;，如下图所示<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">在&#8220;全局<span lang="EN-US">J2C</span>认证别名&#8221;界面点击&#8220;新建&#8221;按钮，进入&#8220;<span lang="EN-US">J2C</span>认证数据建立&#8221;界面，分别输入别名（用户自定义）、用户标识、密码，然后点击&#8220;确定&#8221;按钮，完成<span lang="EN-US">J2C</span>认证数据的创建，如下图所示<span lang="EN-US">:<o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">()<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">回到&#8220;设置安全性别名&#8221;，选择&#8220;组件管理的认证别名&#8221;和&#8220;容器管理的认证别名&#8221;<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">e. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">点击&#8220;下一步&#8221;按钮，进入&#8220;创建数据源摘要&#8221;界面，检查创建时录入的信息是<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">否正确，如果正确点击&#8220;完成&#8221;按钮，完成&#8220;数据源&#8221;建立，如图所示：<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">f. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">点击保存到主配置，进行测试链接，测试连接是否成功，选择创建的数据源点击<span lang="EN-US"><o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">&#8220;测试连接&#8221;按钮，如果一切成功则出现如下图所示界面，<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">否则请返回以上步骤，<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; margin: auto 0cm; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly" class="noindent"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'"><font face="宋体">认证检查配置的属性是否正确。<span lang="EN-US"><o:p></o:p></span></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><font face="宋体"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US">3. </span><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">在<span lang="EN-US">Spring</span>的<span lang="EN-US"> applicationContext.xml </span>文件中配置<span lang="EN-US">dataSource<o:p></o:p></span></span></font></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;bean id="dataSource"<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">class="org.springframework.jndi.JndiObjectFactoryBean"&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;property name="jndiName"&gt; &lt;value&gt;<font size="4">jndids</font>&lt;/value&gt; &lt;/property&gt;<o:p></o:p></font></span></p>
<p style="text-justify: inter-ideograph; text-align: justify; line-height: 20pt; text-indent: 26pt; mso-pagination: none; mso-char-indent-count: 2.0; mso-line-height-rule: exactly"><span style="font-size: 13pt; mso-bidi-font-size: 10.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'" lang="EN-US"><font face="宋体">&lt;/bean&gt;<o:p></o:p></font></span></p><img src ="http://www.blogjava.net/qiubite520/aggbug/423462.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qiubite520/" target="_blank">丘比特</a> 2015-03-14 20:47 <a href="http://www.blogjava.net/qiubite520/archive/2015/03/14/423462.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>H2数据库的Collation中文排序问题解决方案</title><link>http://www.blogjava.net/qiubite520/archive/2014/02/12/409778.html</link><dc:creator>丘比特</dc:creator><author>丘比特</author><pubDate>Wed, 12 Feb 2014 08:50:00 GMT</pubDate><guid>http://www.blogjava.net/qiubite520/archive/2014/02/12/409778.html</guid><wfw:comment>http://www.blogjava.net/qiubite520/comments/409778.html</wfw:comment><comments>http://www.blogjava.net/qiubite520/archive/2014/02/12/409778.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qiubite520/comments/commentRss/409778.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qiubite520/services/trackbacks/409778.html</trackback:ping><description><![CDATA[<span style="color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;">最近用 Scala &amp; Lift 做个小项目，用到H2数据库。结果在对中文字段进行排序时发现点问题。在不设置Collation的情况下，对中文字段的排序结果是乱的（谁让中国人喜欢拼音排序呢）。发现这一现象后，将Collation设为 CHINESE_CHINA看看（注意设置collation要在数据库中还没创建任何表的时候喔），</span><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><span style="color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;">set collation CHINESE_CHINA&nbsp;</span><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><span style="color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;">结果还是不尽如人意，虽然绝大多数记录排序是正确的（按拼音排序），但还是有少量比较生僻的字给单独排在了最后。试想如果某个领导的名字按拼音排序本来要排在前面的，结果因为生僻字给排到了最后，被领导发现了会不会不高兴给你小鞋穿呢？要尽善尽美怎么办呢？查了一下H2的文档，讲到设置collation的时候可以调用 ICU4J（ICU for java）来替代使用内置的collation机制。（不知道ICU，你out了吧，要不要google一下先？！）。 到ICU网站下载了icu4j.jar，将其加入到 CLASSPATH中，重启H2的服务。再次创建数据库，创建数据库后立即在没有创建表的情况下输入下列命令设置collation:</span><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><span style="color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;">set collation ICU4J_CHINESE_CHINA&nbsp;</span><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><br style="word-wrap: break-word; word-break: break-all; padding: 0px; margin: 0px; color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;" /><span style="color: #656d77; font-family: 宋体; line-height: 25px; background-color: #ffffff;">再次说明，如果已经创建了表，此命令是无效的喔。将collation设置为ICU4J_CHINESE_CHINA 后，中文排序就OK了！</span><img src ="http://www.blogjava.net/qiubite520/aggbug/409778.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qiubite520/" target="_blank">丘比特</a> 2014-02-12 16:50 <a href="http://www.blogjava.net/qiubite520/archive/2014/02/12/409778.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>