﻿<?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-yxhxj2006</title><link>http://www.blogjava.net/yxhxj2006/</link><description /><language>zh-cn</language><lastBuildDate>Thu, 30 Apr 2026 05:54:27 GMT</lastBuildDate><pubDate>Thu, 30 Apr 2026 05:54:27 GMT</pubDate><ttl>60</ttl><item><title>jQuery 插件autocomplete 应用</title><link>http://www.blogjava.net/yxhxj2006/archive/2016/06/17/430949.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Fri, 17 Jun 2016 09:54:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2016/06/17/430949.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/430949.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2016/06/17/430949.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/430949.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/430949.html</trackback:ping><description><![CDATA[<h1><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;">项目中有时会用到自动补全查询，就像Google搜索框、淘宝商品搜索功能，输入汉字或字母，则以该汉字或字母开头的相关条目会显示出来供用户选择，&nbsp;<strong>autocomplete</strong>插件就是完成这样的功能。</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;">　　<strong>autocomplete官网</strong>&nbsp;：&nbsp;<a href="http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/" style="color: #1a8bc8; text-decoration: none;">http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/</a>&nbsp;<span style="line-height: 1.5; color: #000000;">（可下载jQuery autocomplete插件）。</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;">　　淘宝商品搜索功能 效果：</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><img alt="" src="http://pic002.cnblogs.com/images/2011/66566/2011102213452415.png" style="border: 0px; max-width: 900px;" /></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;">　　下面来使用 autocomplete插件来实现类似效果。</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;"><strong>1.</strong>&nbsp;创建 AjaxPage.aspx 页面，在其中定义 WebMethod 方法来返回 搜索页面需要的输入框所有提示条目。 后台代码如下：</span></p><div style="margin: 5px 0px; font-weight: normal; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #008080; line-height: 1.5 !important;"> 1</span> <span style="color: #0000ff; line-height: 1.5 !important;">using</span> System.Collections.Generic;<br /><span style="color: #008080; line-height: 1.5 !important;"> 2</span> <span style="color: #0000ff; line-height: 1.5 !important;">using</span> System.IO;<br /><span style="color: #008080; line-height: 1.5 !important;"> 3</span> <span style="color: #0000ff; line-height: 1.5 !important;">using</span> System.Runtime.Serialization.Json;<br /><span style="color: #008080; line-height: 1.5 !important;"> 4</span> <span style="color: #0000ff; line-height: 1.5 !important;">using</span> System.Web.Services;<br /><span style="color: #008080; line-height: 1.5 !important;"> 5</span> <br /><span style="color: #008080; line-height: 1.5 !important;"> 6</span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">partial</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span> AjaxPage : System.Web.UI.Page<br /><span style="color: #008080; line-height: 1.5 !important;"> 7</span> {<br /><span style="color: #008080; line-height: 1.5 !important;"> 8</span>     [WebMethod]<br /><span style="color: #008080; line-height: 1.5 !important;"> 9</span>     <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">string</span> GetAllHints()<br /><span style="color: #008080; line-height: 1.5 !important;">10</span>     {<br /><span style="color: #008080; line-height: 1.5 !important;">11</span>         Dictionary&lt;<span style="color: #0000ff; line-height: 1.5 !important;">string</span>, <span style="color: #0000ff; line-height: 1.5 !important;">string</span>&gt; data = <span style="color: #0000ff; line-height: 1.5 !important;">new</span> Dictionary&lt;<span style="color: #0000ff; line-height: 1.5 !important;">string</span>, <span style="color: #0000ff; line-height: 1.5 !important;">string</span>&gt;();<br /><span style="color: #008080; line-height: 1.5 !important;">12</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">苹果4代iphone正品</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">21782</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">13</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">苹果4代 手机套</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">238061</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">14</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">苹果4</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">838360</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">15</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">苹果皮</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">242721</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">16</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">苹果笔记本</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">63348</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">17</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">苹果4s</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">24030</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">18</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">戴尔笔记本</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">110105</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">19</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">戴尔手机</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">18870</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">20</span>         data.Add(<span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">戴尔键盘</span><span style="color: #800000; line-height: 1.5 !important;">"</span>, <span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">30367</span><span style="color: #800000; line-height: 1.5 !important;">"</span>);<br /><span style="color: #008080; line-height: 1.5 !important;">21</span> <br /><span style="color: #008080; line-height: 1.5 !important;">22</span>         DataContractJsonSerializer serializer = <span style="color: #0000ff; line-height: 1.5 !important;">new</span> DataContractJsonSerializer(data.GetType());<br /><span style="color: #008080; line-height: 1.5 !important;">23</span> <br /><span style="color: #008080; line-height: 1.5 !important;">24</span>         <span style="color: #0000ff; line-height: 1.5 !important;">using</span> (MemoryStream ms = <span style="color: #0000ff; line-height: 1.5 !important;">new</span> MemoryStream())<br /><span style="color: #008080; line-height: 1.5 !important;">25</span>         {<br /><span style="color: #008080; line-height: 1.5 !important;">26</span>             serializer.WriteObject(ms, data);<br /><span style="color: #008080; line-height: 1.5 !important;">27</span>             <span style="color: #0000ff; line-height: 1.5 !important;">return</span> System.Text.Encoding.UTF8.GetString(ms.ToArray());<br /><span style="color: #008080; line-height: 1.5 !important;">28</span>         }<br /><span style="color: #008080; line-height: 1.5 !important;">29</span>     }<br /><span style="color: #008080; line-height: 1.5 !important;">30</span> }</pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; border: none !important;" /></a></span></div></div><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;">　　注：该方法返回的数据格式为json字符串。</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;"><strong>2.</strong>&nbsp;创建搜索页面 Index.aspx， 前台代码如下：</span></p><div style="margin: 5px 0px; font-weight: normal; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #008080; line-height: 1.5 !important;"> 1</span> <span style="line-height: 1.5 !important; background-color: #ffff00;">&lt;%</span><span style="line-height: 1.5 !important;">@ Page Language</span><span style="line-height: 1.5 !important;">=</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">C#</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;"> AutoEventWireup</span><span style="line-height: 1.5 !important;">=</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">true</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">  CodeFile</span><span style="line-height: 1.5 !important;">=</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">Index.aspx.cs</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;"> Inherits</span><span style="line-height: 1.5 !important;">=</span><span style="color: #800000; line-height: 1.5 !important;">"</span><span style="color: #800000; line-height: 1.5 !important;">_Default</span><span style="color: #800000; line-height: 1.5 !important;">"</span> <span style="line-height: 1.5 !important; background-color: #ffff00;">%&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;"> 2</span> <br /><span style="color: #008080; line-height: 1.5 !important;"> 3</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;!</span><span style="color: #ff00ff; line-height: 1.5 !important;">DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;"> 4</span> <br /><span style="color: #008080; line-height: 1.5 !important;"> 5</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">html </span><span style="color: #ff0000; line-height: 1.5 !important;">xmlns</span><span style="color: #0000ff; line-height: 1.5 !important;">="http://www.w3.org/1999/xhtml"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;"> 6</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">head </span><span style="color: #ff0000; line-height: 1.5 !important;">runat</span><span style="color: #0000ff; line-height: 1.5 !important;">="server"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;"> 7</span>     <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">title</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">title</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;"> 8</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">link </span><span style="color: #ff0000; line-height: 1.5 !important;">rel</span><span style="color: #0000ff; line-height: 1.5 !important;">="Stylesheet"</span><span style="color: #ff0000; line-height: 1.5 !important;"> href</span><span style="color: #0000ff; line-height: 1.5 !important;">="Styles/jquery.autocomplete.css"</span> <span style="color: #0000ff; line-height: 1.5 !important;">/&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;"> 9</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">script </span><span style="color: #ff0000; line-height: 1.5 !important;">type</span><span style="color: #0000ff; line-height: 1.5 !important;">="text/javascript"</span><span style="color: #ff0000; line-height: 1.5 !important;"> src</span><span style="color: #0000ff; line-height: 1.5 !important;">="Scripts/jquery-1.4.1.js"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">script</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">10</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">script </span><span style="color: #ff0000; line-height: 1.5 !important;">type</span><span style="color: #0000ff; line-height: 1.5 !important;">="text/javascript"</span><span style="color: #ff0000; line-height: 1.5 !important;"> src</span><span style="color: #0000ff; line-height: 1.5 !important;">="Scripts/jquery.autocomplete.js"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">script</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">11</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">script </span><span style="color: #ff0000; line-height: 1.5 !important;">type</span><span style="color: #0000ff; line-height: 1.5 !important;">="text/javascript"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><span style="line-height: 1.5 !important;"><br /></span><span style="color: #008080; line-height: 1.5 !important;">12</span>  <span style="color: #0000ff; line-height: 1.5 !important;">var</span><span style="line-height: 1.5 !important;"> v </span><span style="line-height: 1.5 !important;">=</span> <span style="line-height: 1.5 !important;">1</span><span style="line-height: 1.5 !important;">;<br /></span><span style="color: #008080; line-height: 1.5 !important;">13</span> <span style="line-height: 1.5 !important;">    $(document).ready(</span><span style="color: #0000ff; line-height: 1.5 !important;">function</span><span style="line-height: 1.5 !important;"> () {<br /></span><span style="color: #008080; line-height: 1.5 !important;">14</span> <span style="line-height: 1.5 !important;">        $.ajax({<br /></span><span style="color: #008080; line-height: 1.5 !important;">15</span> <span style="line-height: 1.5 !important;">            type: </span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">POST</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">,<br /></span><span style="color: #008080; line-height: 1.5 !important;">16</span> <span style="line-height: 1.5 !important;">            contentType: </span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">application/json</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">,<br /></span><span style="color: #008080; line-height: 1.5 !important;">17</span> <span style="line-height: 1.5 !important;">            url: </span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">AjaxPage.aspx/GetAllHints</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">,<br /></span><span style="color: #008080; line-height: 1.5 !important;">18</span> <span style="line-height: 1.5 !important;">            data: </span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">{}</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">,<br /></span><span style="color: #008080; line-height: 1.5 !important;">19</span> <span style="line-height: 1.5 !important;">            dataType: </span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">json</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">,<br /></span><span style="color: #008080; line-height: 1.5 !important;">20</span> <span style="line-height: 1.5 !important;">            success: </span><span style="color: #0000ff; line-height: 1.5 !important;">function</span><span style="line-height: 1.5 !important;"> (msg) {<br /></span><span style="color: #008080; line-height: 1.5 !important;">21</span>  <span style="color: #0000ff; line-height: 1.5 !important;">var</span><span style="line-height: 1.5 !important;"> datas </span><span style="line-height: 1.5 !important;">=</span><span style="line-height: 1.5 !important;"> eval(</span><span style="line-height: 1.5 !important;">'</span><span style="line-height: 1.5 !important;">(</span><span style="line-height: 1.5 !important;">'</span> <span style="line-height: 1.5 !important;">+</span><span style="line-height: 1.5 !important;"> msg.d </span><span style="line-height: 1.5 !important;">+</span> <span style="line-height: 1.5 !important;">'</span><span style="line-height: 1.5 !important;">)</span><span style="line-height: 1.5 !important;">'</span><span style="line-height: 1.5 !important;">);<br /></span><span style="color: #008080; line-height: 1.5 !important;">22</span> <span style="line-height: 1.5 !important;">                $(</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">#txtIput</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">).autocomplete(datas, {<br /></span><span style="color: #008080; line-height: 1.5 !important;">23</span> <span style="line-height: 1.5 !important;">                    formatItem: </span><span style="color: #0000ff; line-height: 1.5 !important;">function</span><span style="line-height: 1.5 !important;"> (row, i, max) {<br /></span><span style="color: #008080; line-height: 1.5 !important;">24</span>  <span style="color: #0000ff; line-height: 1.5 !important;">return</span> <span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">&lt;table width='400px'&gt;&lt;tr&gt;&lt;td align='left'&gt;</span><span style="line-height: 1.5 !important;">"</span> <span style="line-height: 1.5 !important;">+</span><span style="line-height: 1.5 !important;"> row.Key </span><span style="line-height: 1.5 !important;">+</span> <span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">&lt;/td&gt;&lt;td align='right'&gt;&lt;font style='color: #009933; font-family: 黑体; font-style: italic'&gt;约</span><span style="line-height: 1.5 !important;">"</span> <span style="line-height: 1.5 !important;">+</span><span style="line-height: 1.5 !important;"> row.Value </span><span style="line-height: 1.5 !important;">+</span> <span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">个宝贝&lt;/font&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</span><span style="line-height: 1.5 !important;">"</span><span style="line-height: 1.5 !important;">;<br /></span><span style="color: #008080; line-height: 1.5 !important;">25</span> <span style="line-height: 1.5 !important;">                    },<br /></span><span style="color: #008080; line-height: 1.5 !important;">26</span> <span style="line-height: 1.5 !important;">                    formatMatch: </span><span style="color: #0000ff; line-height: 1.5 !important;">function</span><span style="line-height: 1.5 !important;">(row, i, max){<br /></span><span style="color: #008080; line-height: 1.5 !important;">27</span>  <span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> row.Key;<br /></span><span style="color: #008080; line-height: 1.5 !important;">28</span> <span style="line-height: 1.5 !important;">                    }<br /></span><span style="color: #008080; line-height: 1.5 !important;">29</span> <span style="line-height: 1.5 !important;">                });<br /></span><span style="color: #008080; line-height: 1.5 !important;">30</span> <span style="line-height: 1.5 !important;">            }<br /></span><span style="color: #008080; line-height: 1.5 !important;">31</span> <span style="line-height: 1.5 !important;">        });<br /></span><span style="color: #008080; line-height: 1.5 !important;">32</span> <span style="line-height: 1.5 !important;">    });<br /></span><span style="color: #008080; line-height: 1.5 !important;">33</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">script</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">34</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">head</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">35</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">body</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">36</span>     <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">form </span><span style="color: #ff0000; line-height: 1.5 !important;">id</span><span style="color: #0000ff; line-height: 1.5 !important;">="form1"</span><span style="color: #ff0000; line-height: 1.5 !important;"> runat</span><span style="color: #0000ff; line-height: 1.5 !important;">="server"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">37</span>     <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">div</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">38</span>     <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">center</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">39</span>         <span style="color: #0000ff; line-height: 1.5 !important;">&lt;</span><span style="color: #800000; line-height: 1.5 !important;">asp:TextBox </span><span style="color: #ff0000; line-height: 1.5 !important;">ID</span><span style="color: #0000ff; line-height: 1.5 !important;">="txtIput"</span><span style="color: #ff0000; line-height: 1.5 !important;"> runat</span><span style="color: #0000ff; line-height: 1.5 !important;">="server"</span><span style="color: #ff0000; line-height: 1.5 !important;"> Width</span><span style="color: #0000ff; line-height: 1.5 !important;">="400px"</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">asp:TextBox</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">40</span>     <span style="color: #0000ff; line-height: 1.5 !important;">&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">center</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">41</span>     <span style="color: #0000ff; line-height: 1.5 !important;">&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">div</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">42</span>     <span style="color: #0000ff; line-height: 1.5 !important;">&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">form</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">43</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">body</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span><br /><span style="color: #008080; line-height: 1.5 !important;">44</span> <span style="color: #0000ff; line-height: 1.5 !important;">&lt;/</span><span style="color: #800000; line-height: 1.5 !important;">html</span><span style="color: #0000ff; line-height: 1.5 !important;">&gt;</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; border: none !important;" /></a></span></div></div><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;">　　实现效果如下：</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><img alt="" src="http://pic002.cnblogs.com/images/2011/66566/2011102214041336.png" style="border: 0px; max-width: 900px;" /></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #000000;"><strong>3.</strong>&nbsp;autocomplete 参数说明</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;"><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;minChars (Number)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">在触发autoComplete前用户至少需要输入的字符数.Default: 1，如果设为0，在输入框内双击或者删除输入框内内容时显示列表</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;width (Number)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">指定下拉框的宽度. Default: input元素的宽度</span><br /><span style="line-height: 1.5; color: #0000ff;"><span style="line-height: 1.5; color: #000000;"><strong><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong></span></strong></span>&nbsp;max (Number)</span><br />&nbsp;&nbsp;&nbsp; autoComplete下拉显示项目的个数.Default: 10<br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;delay (Number)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">击键后激活autoComplete的延迟时间(单位毫秒).Default: 远程为400 本地10</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;autoFill (Boolean)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">要不要在用户选择时自动将用户当前鼠标所在的值填入到input框. Default: false</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;mustMatch (Booolean)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">如果设置为true,autoComplete只会允许匹配的结果出现在输入框,所有当用户输入的是非法字符时将会得不到下拉框.Default: false</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;matchContains (Boolean)</span><br />&nbsp;&nbsp;&nbsp; 决定比较时是否要在字符串内部查看匹配,如ba是否与foo bar中的ba匹配.使用缓存时比较重要.不要和autofill混用.Default: false<br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;selectFirst (Boolean)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">如果设置成true,在用户键入tab或return键时autoComplete下拉列表的第一个值将被自动选择,尽管它没被手工选中(用键盘或鼠标).当然如果用户选中某个项目,那么就用用户选中的值. Default: true</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;cacheLength (Number)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">缓存的长度.即对从数据库中取到的结果集要缓存多少条记录.设成1为不缓存.Default: 10</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;matchSubset (Boolean)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">autoComplete可不可以使用对服务器查询的缓存,如果缓存对foo的查询结果,那么如果用户输入foo就不需要再进行检索了,直接使用缓存.通常是打开这个选项以减轻服务器的负担以提高性能.只会在缓存长度大于1时有效.Default: true</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;matchCase (Boolean)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">比较是否开启大小写敏感开关.使用缓存时比较重要.如果你理解上一个选项,这个也就不难理解,就好比foot要不要到FOO的缓存中去找.Default: false</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;multiple (Boolean)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">是否允许输入多个值即多次使用autoComplete以输入多个值. Default: false</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;multipleSeparator (String)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">如果是多选时,用来分开各个选择的字符. Default: ","</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;scroll (Boolean)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">当结果集大于默认高度时是否使用卷轴显示 Default: true</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;scrollHeight (Number)</span><br />&nbsp;&nbsp;&nbsp; 自动完成提示的卷轴高度用像素大小表示 Default: 180&nbsp;&nbsp;<br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;formatItem (Function)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">为每个要显示的项目使用高级标签.即对结果中的每一行都会调用这个函数,返回值将用LI元素包含显示在下拉列表中. Autocompleter会提供三个参数(row, i, max): 返回的结果数组, 当前处理的行数(即第几个项目,是从1开始的自然数), 当前结果数组元素的个数即项目的个数. Default: none, 表示不指定自定义的处理函数,这样下拉列表中的每一行只包含一个值.</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;formatResult (Function)</span><br />&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">&nbsp;和formatItem类似,但可以将将要输入到input文本框内的值进行格式化.同样有三个参数,和formatItem一样.Default: none,表示要么是只有数据,要么是使用formatItem提供的值.</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;formatMatch (Function)</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">对每一行数据使用此函数格式化需要查询的数据格式. 返回值是给内部搜索算法使用的. 参数值row</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;extraParams (Object)</span><br />&nbsp;&nbsp;&nbsp;<span style="line-height: 1.5; color: #000000;">&nbsp;为后台(一般是服务端的脚本)提供更多的参数.和通常的作法一样是使用一个键值对对象.如果传过去的值是{ bar:4 },将会被autocompleter解析成my_autocomplete_backend.php?q=foo&amp;bar=4 (假设当前用户输入了foo). Default: {}</span><br /><span style="line-height: 1.5; color: #0000ff;"><strong>*</strong>&nbsp;result (handler)</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp; 此事件会在用户选中某一项后触发，参数为：</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp; event: 事件对象. event.type为result.</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp; data: 选中的数据行.</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp; formatted:formatResult函数返回的值</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp; 例如：</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp; $("#singleBirdRemote").result(function(event, data, formatted) {</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //如选择后给其他控件赋值，触发别的事件等等</span><br /><span style="line-height: 1.5; color: #000000;">&nbsp;&nbsp;&nbsp; });</span></p><p style="line-height: 19.5px; margin-top: 10px; margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; background-color: #ffffff;">&nbsp;</p></h1><img src ="http://www.blogjava.net/yxhxj2006/aggbug/430949.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2016-06-17 17:54 <a href="http://www.blogjava.net/yxhxj2006/archive/2016/06/17/430949.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>防止重复登录请求</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/12/03/428505.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Thu, 03 Dec 2015 08:03:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/12/03/428505.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/428505.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/12/03/428505.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/428505.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/428505.html</trackback:ping><description><![CDATA[<span style="color: #333333; font-family: arial, 宋体, sans-serif, tahoma, 'Microsoft YaHei'; line-height: 24px; background-color: #ffffff;">过页头生成Token,进行请求验证,解决Ajax请求安全问题。目前为止我做的最多的防止ajax请求攻击的就是添加验证码、添加随机Token,限制同一请求在规</span><span style="color: #333333; font-family: arial, 宋体, sans-serif, tahoma, 'Microsoft YaHei'; line-height: 24px; background-color: #ffffff;">定时间内的最大请求数。<br /><br />下面重点说说添加随机Token限制：<br /></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->token是为了防止表单重复提交，token&nbsp;原理大致为：<br /><br />1：显示表单的那个&nbsp;action&nbsp;中使用&nbsp;createToken()&nbsp;生成一个随机的&nbsp;token值，并存放在服务端(session或者cache中)，并且传递一份到页面中<br /><br />2：表单页面使用一个隐藏表单域获取后端传过来的&nbsp;token值，该表单页面提交时会将此&nbsp;token&nbsp;值一同提交到后端<br /><br />3：在表单页面提交到的&nbsp;actioin&nbsp;中使用&nbsp;validateToken()&nbsp;将服务端与表单隐藏域中的&nbsp;token&nbsp;值进行对比，如果服务端存在&nbsp;token值并且与表单提交过来的值相等，证明是第一次提交。<br /><br />4：每次校验过后服务端的&nbsp;token&nbsp;值会立即被清除，所以当用户重复提交时，后面的提交校验都再也无法通过。从而实现了防止重复提交的功能，validateToken&nbsp;是在&nbsp;<span style="color: #0000FF; ">synchronized</span>&nbsp;块中执行的保障了多线程下的安全性。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;token&nbsp;会优先存入&nbsp;me.setTokenCache(ITokenCache)&nbsp;指定的&nbsp;TokenCache&nbsp;中，如果未指定则默认使用&nbsp;session&nbsp;来存放</div><br /><p style="padding: 0px; margin: 0px 0px 10px; color: #333333; font-family: 'Microsoft YaHei', Verdana, sans-serif, SimSun; font-size: 12px; line-height: normal;">但是这种机制是有问题的，比如我是用ajax提交表单，提交完成以后表单页面并不刷新，然后我修改了部分数据以后再次提交页面，那么token还是之前的那个token，后台会以为这个为重复提交不能通过校验，那么请求就不能完成，数据无法得到正确的处理。我认为合理的机制应该是这样的：</p><p style="padding: 0px; margin: 0px 0px 10px; color: #333333; font-family: 'Microsoft YaHei', Verdana, sans-serif, SimSun; font-size: 12px; line-height: normal;">1：显示表单的那个 action 中使用 createToken() 生成一个随机的 token值，并且传递一份到页面中</p><p style="padding: 0px; margin: 0px 0px 10px; color: #333333; font-family: 'Microsoft YaHei', Verdana, sans-serif, SimSun; font-size: 12px; line-height: normal;">2：表单页面使用一个隐藏表单域获取后端传过来的 token值，该表单页面提交时会将此 token 值一同提交到后端</p><p style="padding: 0px; margin: 0px 0px 10px; color: #333333; font-family: 'Microsoft YaHei', Verdana, sans-serif, SimSun; font-size: 12px; line-height: normal;">3：将提交过来的token值放入session或者cache中，然后执行controller中的代码，代码全部执行完以后，再把存入session或cache中的token值删除掉；验证用户是否为重复提交只需要验证提交过来的token是否存在于session或cache中，有则为重复提交，无则为正常提交。</p><p style="padding: 0px; margin: 0px 0px 10px; color: #333333; font-family: 'Microsoft YaHei', Verdana, sans-serif, SimSun; font-size: 12px; line-height: normal;">4：该逻辑应该可以写成一个Interceptor,在需要的地方加上，或者直接设为全局拦截器都是可以的，简单，快捷；</p><img src ="http://www.blogjava.net/yxhxj2006/aggbug/428505.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-12-03 16:03 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/12/03/428505.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Java中直接调用js代码</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/11/19/428272.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Wed, 18 Nov 2015 16:25:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/11/19/428272.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/428272.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/11/19/428272.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/428272.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/428272.html</trackback:ping><description><![CDATA[<p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">JDK1.6版添加了新的ScriptEngine类，允许用户直接执行js代码。</p><h3><a name="t0" style="color: rgb(51, 102, 153);"></a>在Java中直接调用js代码</h3><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">不能调用浏览器中定义的js函数，会抛出异常提示ReferenceError: &#8220;alert&#8221; is not defined。</p><div style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;"><table width="869" style="height: 426px;"><tbody><tr><td>&nbsp;</td><td><pre style="white-space: pre-wrap; word-wrap: break-word;">package com.sinaapp.manjushri;&nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">import javax.script.ScriptEngine;&nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">import javax.script.ScriptEngineManager;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">import javax.script.ScriptException; &nbsp; /**  * 直接调用js代码  */</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">public class ScriptEngineTest { &nbsp; &nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">public static void main(String[] args) {&nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">  ScriptEngineManager manager = new ScriptEngineManager();</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">  ScriptEngine engine = manager.getEngineByName("javascript");</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">     try{                engine.eval("var a=3; var b=4;print (a+b);");           // engine.eval("alert(\"js alert\");");    // 不能调用浏览器中定义的js函数 // 错误，会抛出alert引用不存在的异常</pre><pre style="white-space: pre-wrap; word-wrap: break-word;"> }catch(ScriptException e){   e.printStackTrace();  }  } &nbsp;  }</pre></td></tr></tbody></table></div><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">输出结果：7<br /></p><h3><a name="t1" style="color: rgb(51, 102, 153);"></a>在Java中绑定js变量</h3><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">在调用engine.get(key);时，如果key没有定义，则返回null</p><div style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;"><table><tbody><tr><td>&nbsp;</td><td><pre style="white-space: pre-wrap; word-wrap: break-word;">package com.sinaapp.manjushri; &nbsp;   import javax.script.Bindings;   import javax.script.ScriptContext;   import javax.script.ScriptEngine;   import javax.script.ScriptEngineManager;   import javax.script.ScriptException; &nbsp;   public class ScriptEngineTest2 {    public static void main(String[] args) {    ScriptEngineManager manager = new ScriptEngineManager();    ScriptEngine engine = manager.getEngineByName("javascript");    engine.put("a", 4);    engine.put("b", 3);    Bindings bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE);   try {                          // 只能为Double，使用Float和Integer会抛出异常      Double result = (Double) engine.eval("a+b");         System.out.println("result = " + result);     engine.eval("c=a+b");      Double c = (Double)engine.get("c");      System.out.println("c = " + c);         } catch (ScriptException e) {     e.printStackTrace();         }      }   }</pre></td></tr></tbody></table></div><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">输出：<br />result = 7.0<br />c = 7.0</p><h3><a name="t2" style="color: rgb(51, 102, 153);"></a>在Java中调用js文件中的function，传入调用参数，并获取返回值</h3><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">js文件中的merge函数将两个参数a，b相加，并返回c。</p><div style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;"><table><tbody><tr><td>&nbsp;</td><td><pre style="white-space: pre-wrap; word-wrap: break-word;">// expression.js&nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">function merge(a, b) {&nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;"> c = a * b;&nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;"> return c;&nbsp;</pre><pre style="white-space: pre-wrap; word-wrap: break-word;">}</pre></td></tr></tbody></table></div><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">在Java代码中读取js文件，并参数两个参数，然后回去返回值。</p><div style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;"><table><tbody><tr><td>&nbsp;</td><td><pre style="white-space: pre-wrap; word-wrap: break-word;">package com.sinaapp.manjushri; &nbsp;   import java.io.FileReader;  &nbsp; import javax.script.Invocable;   import javax.script.ScriptEngine;   import javax.script.ScriptEngineManager; &nbsp;  /**  * Java调用并执行js文件，传递参数，并活动返回值  *   * @author manjushri  */   public class ScriptEngineTest { &nbsp;    public static void main(String[] args) throws Exception {    ScriptEngineManager manager = new ScriptEngineManager();    ScriptEngine engine = manager.getEngineByName("javascript"); &nbsp;     String jsFileName = "expression.js";   // 读取js文件     FileReader reader = new FileReader(jsFileName);   // 执行指定脚本    engine.eval(reader);     if(engine instanceof Invocable) {     Invocable invoke = (Invocable)engine;    // 调用merge方法，并传入两个参数      // c = merge(2, 3);      Double c = (Double)invoke.invokeFunction("merge", 2, 3);      System.out.println("c = " + c);    }     reader.close();      } }</pre></td></tr></tbody></table></div><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;">输出结果：<br />c = 5.0</p><hr style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;" /><p style="color: #333333; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; line-height: 25px; background-color: #ffffff;"><strong>java调用脚本语言笔记（jython,jruby,groovy）</strong></p><div id="article_content" style="margin: 20px 0px 0px; font-stretch: normal; line-height: 25px; font-family: 'Helvetica Neue', Tahoma, Arial, 'Microsoft YaHei', 微软雅黑; color: #333333; background-color: #ffffff;"><p>&nbsp;有两种方法<br />1.java se 6以后实现了jsr 223规范<br />java代码：</p><div bg_java"="" style="width: 700.90625px;"><div><div><strong>[java]</strong></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;factory&nbsp;=&nbsp;new&nbsp;ScriptEngineManager();&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;scriptEngine&nbsp;=&nbsp;factory.getEngineByName("javascript");//或者"js"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">scriptEngine.eval(code);//执行一段脚本，code是js代码&nbsp;&nbsp;</li></ol></div><p><br />&nbsp;很方便调用脚本</p><p>2.可以使用脚本语方本身提供的与java的集成手段</p><p>jython集成<br />使用jsr223:<br />前提下载jython的包，已实现jsr223<br />(建议在官网上下载，在安装目录下有jython.jar，<a href="http://repo2.maven.org/maven2/org/python/jython/2.5.0/" style="color: #4169e1; text-decoration: none;">http://repo2.maven.org/maven2/org/python/jython/2.5.0/</a>&nbsp;这里也有，但是这个包里没有jsr223的实现，看包下存不存在org.python.jsr223)</p><div bg_java"="" style="width: 700.90625px;"><div><div><strong>[java]</strong></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;factory&nbsp;=&nbsp;new&nbsp;ScriptEngineManager();&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;scriptEngine&nbsp;=&nbsp;factory.getEngineByName("python");//或者"jython"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">scriptEngine.eval(code);&nbsp;&nbsp;</li></ol></div><p><br />使用PythonInterpreter，可以调用exec(String code)方法:</p><div bg_java"="" style="width: 700.90625px;"><div><div><strong>[java]</strong></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">PythonInterpreter&nbsp;interpreter&nbsp;=&nbsp;new&nbsp;PythonInterpreter();&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">interpreter.exec(code);&nbsp;&nbsp;</li></ol></div><p><strong>访问数据库<br /></strong>使用jdbc:</p><div bg_python"="" style="width: 700.90625px;"><div><div><strong>[python]</strong>&nbsp;<a title="view plain" href="http://blog.csdn.net/anbo724/article/details/6607818" style="color: #4169e1; padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-position: 0% 0%; background-repeat: no-repeat;"><br /></a></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">from&nbsp;oracle.jdbc.driver&nbsp;import&nbsp;OracleDriver&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">from&nbsp;java.sql&nbsp;import&nbsp;DriverManager&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">username&nbsp;=&nbsp;'hr'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">password&nbsp;=&nbsp;'123456'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">url&nbsp;=&nbsp;'jdbc:oracle:thin:@localhost:1521:XE'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">driver&nbsp;=&nbsp;OracleDriver()&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">DriverManager.registerDriver(driver)&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">conn&nbsp;=&nbsp;DriverManager.getConnection(url,&nbsp;username,&nbsp;password)&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">stmt&nbsp;=&nbsp;conn.createStatement()&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">sql&nbsp;=&nbsp;"select&nbsp;salary&nbsp;from&nbsp;EMPLOYEES&nbsp;t&nbsp;where&nbsp;t.salary&lt;2300"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">rs&nbsp;=&nbsp;stmt.executeQuery(sql)&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">while&nbsp;(rs.next()):&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;print&nbsp;rs.getInt('salary')&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">rs.close()&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">stmt.close()&nbsp;&nbsp;</li></ol></div><p><br />&nbsp;结果:<br />2200<br />2100<br />2200</p><p>使用zxJDBC :</p><div bg_python"="" style="width: 700.90625px;"><div><div><strong>[python]</strong>&nbsp;<a title="view plain" href="http://blog.csdn.net/anbo724/article/details/6607818" style="color: #4169e1; padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-position: 0% 0%; background-repeat: no-repeat;"><br /></a></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">from&nbsp;com.ziclix.python.sql&nbsp;import&nbsp;zxJDBC&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">url&nbsp;=&nbsp;'jdbc:oracle:thin:@localhost:1521:XE'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">username&nbsp;=&nbsp;'hr'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">password&nbsp;=&nbsp;'123456'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">driverName&nbsp;=&nbsp;'oracle.jdbc.driver.OracleDriver'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">mysqlConn&nbsp;=&nbsp;zxJDBC.connect(url,username,&nbsp;password,driverName)&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">cursor&nbsp;=&nbsp;mysqlConn.cursor()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">cursor.execute("select&nbsp;last_name&nbsp;from&nbsp;EMPLOYEES&nbsp;t&nbsp;where&nbsp;t.salary&lt;2300");&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">#print&nbsp;cursor.fetchone()&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">list&nbsp;=&nbsp;cursor.fetchall()&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">for&nbsp;record&nbsp;in&nbsp;list:&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;"name:"+record[0]&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">#print&nbsp;cursor.description[0]&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">#print&nbsp;cursor.description[1]&nbsp;&nbsp;</li></ol></div><p><br />&nbsp;结果:<br />name:麦克<br />name:Olson<br />name:Philtanker</p><p>从数据库中查出的中文内容正常的。<br />而在代码里面的中文全部是乱码或抛异常，未解决。</p><p><strong>与jruby集成<br /></strong>使用jsr223:Java代码</p><div bg_java"="" style="width: 700.90625px;"><div><div><strong>[java]</strong></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;factory&nbsp;=&nbsp;new&nbsp;ScriptEngineManager();&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;scriptEngine&nbsp;=&nbsp;factory.getEngineByName("jruby");//或者"ruby"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">scriptEngine.eval(code);&nbsp;&nbsp;</li></ol></div><p>&nbsp;<strong>访问数据库</strong></p><p><strong>Ruby代码</strong></p><div bg_ruby"="" style="width: 700.90625px;"><div><div><strong>[ruby]</strong>&nbsp;<a title="view plain" href="http://blog.csdn.net/anbo724/article/details/6607818" style="color: #4169e1; padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-position: 0% 0%; background-repeat: no-repeat;"><br /></a></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">require&nbsp;'java'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">module&nbsp;JavaLang&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;include_package&nbsp;"java.lang"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">end&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">module&nbsp;JavaSql&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;include_package&nbsp;'java.sql'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">end&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">begin&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;username&nbsp;=&nbsp;'hr'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;password&nbsp;=&nbsp;'123456'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;url&nbsp;=&nbsp;'jdbc:oracle:thin:@localhost:1521:XE'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;driverName&nbsp;=&nbsp;'oracle.jdbc.driver.OracleDriver'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;JavaLang::Class.forName(driverName).newInstance&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;conn&nbsp;=&nbsp;JavaSql::DriverManager.getConnection(url,&nbsp;username,&nbsp;password)&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;stmt&nbsp;=&nbsp;conn.createStatement&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;sql&nbsp;=&nbsp;"select&nbsp;last_name&nbsp;from&nbsp;EMPLOYEES&nbsp;t&nbsp;where&nbsp;t.salary&lt;2300"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;rs&nbsp;=&nbsp;stmt.executeQuery(sql)&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;while&nbsp;(rs.next)&nbsp;do&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;puts&nbsp;"名字:"+rs.getString("last_name")&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;end&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;rs.close&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;stmt.close&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;conn.close()&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">rescue&nbsp;JavaLang::ClassNotFoundException&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;puts&nbsp;"ClassNotFoundException"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">rescue&nbsp;JavaSql::SQLException&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;puts&nbsp;"SQLException"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">end&nbsp;&nbsp;</li></ol></div><p><br />&nbsp;</p><p>&nbsp;结果:<br />名字:楹﹀厠<br />名字:Olson<br />名字:Philtanker</p><p>&nbsp;</p><p>从数据库中查出的中文内容为乱码的。<br />而在代码里面的中文正常。</p><p>&nbsp;</p><p><strong>与groovy集成<br /></strong>使用jsr223:</p><p>Java代码</p><div bg_java"="" style="width: 700.90625px;"><div><div><strong>[java]</strong>&nbsp;<a title="view plain" href="http://blog.csdn.net/anbo724/article/details/6607818" style="color: #4169e1; padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-position: 0% 0%; background-repeat: no-repeat;"><br /></a></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;factory&nbsp;=&nbsp;new&nbsp;ScriptEngineManager();&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">ScriptEngineManager&nbsp;scriptEngine&nbsp;=&nbsp;factory.getEngineByName("groovy");//或者"Groovy"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">scriptEngine.eval(code);&nbsp;&nbsp;</li></ol></div><p><br />&nbsp;使用GroovyShell:</p><p>Java代码</p><div bg_java"="" style="width: 700.90625px;"><div><div><strong>[java]</strong>&nbsp;<a title="view plain" href="http://blog.csdn.net/anbo724/article/details/6607818" style="color: #4169e1; padding: 1px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px; background-image: url(http://static.blog.csdn.net/scripts/SyntaxHighlighter/styles/images/default/ico_plain.gif); background-position: 0% 0%; background-repeat: no-repeat;"><br /></a></div></div><ol start="1"><li style="list-style-type: none; line-height: 18px;">GroovyShell&nbsp;shell&nbsp;=&nbsp;new&nbsp;GroovyShell();&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">Script&nbsp;script&nbsp;=&nbsp;shell.parse(code);&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">Object&nbsp;result&nbsp;=&nbsp;script.run();&nbsp;&nbsp;</li></ol></div><p><br />访问数据库</p><div style="width: 700.90625px;"><div><div>Groovy代码</div></div></div><p>&nbsp;</p><div bg_plain"="" style="width: 700.90625px;"><ol start="1"><li style="list-style-type: none; line-height: 18px;">import&nbsp;groovy.sql.Sql&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">def&nbsp;username&nbsp;=&nbsp;'hr'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">def&nbsp;password&nbsp;=&nbsp;'123456'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">def&nbsp;url&nbsp;=&nbsp;'jdbc:oracle:thin:@localhost:1521:XE'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">def&nbsp;driverName&nbsp;=&nbsp;'oracle.jdbc.driver.OracleDriver'&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">def&nbsp;sql&nbsp;=&nbsp;Sql.newInstance(url,&nbsp;username,&nbsp;password,&nbsp;driverName)&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">sql.eachRow("select&nbsp;last_name&nbsp;from&nbsp;EMPLOYEES&nbsp;t&nbsp;where&nbsp;t.salary&lt;2300")&nbsp;{&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">&nbsp;println&nbsp;"名字：${it.last_name}"&nbsp;&nbsp;</li><li style="list-style-type: none; line-height: 18px;">}&nbsp;&nbsp;</li></ol></div><p>结果:<br />名字：麦克<br />名字：Olson<br />名字：Philtanker</p><p>&nbsp;</p><p>在使用groovy过程中碰到了一个异常<br />Exception in thread "main" java.lang.VerifyError: (class: groovy/runtime/metaclass/java/util/ArrayListMetaClass, method: super$2$invokeMethod signature: (Ljava/lang/Class;Ljava/lang/Object;Ljava/lang/String;[Ljava/lang/Object;ZZ)Ljava/lang/Object;) Illegal use of nonvirtual function call<br />这个异常解决花了很长时间<br />是因为在原来项目中存在json-lib-2.1.jar(有可能名称为json-lib-2.1-jdk15.jar)，这个包是用来处理json的，与groovy1.7.5存在冲突,更新为json-lib-2.3.jar即可<br />(json-lib里有一些groovy运行时处理的内容)</p></div><img src ="http://www.blogjava.net/yxhxj2006/aggbug/428272.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-11-19 00:25 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/11/19/428272.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java导入证书的问题(PKIX：unable to find valid certification path to requested target 的问题)</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/10/30/427988.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Fri, 30 Oct 2015 07:06:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/10/30/427988.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/427988.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/10/30/427988.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/427988.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/427988.html</trackback:ping><description><![CDATA[<p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">这两天Java服务器上忽然遇到这样的异常：</p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="background-color: #cccccc;">avax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target</span><br /></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><strong>问题的根本是：</strong></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">缺少安全证书时出现的异常。<br /></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><strong>解决问题方法：</strong></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">将你要访问的webservice/url....的安全认证证书导入到客户端即可。</p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br /></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">以下是获取安全证书的一种方法，通过以下程序获取安全证书：</p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">/*</span><span style="color: #008000; "><br />&nbsp;*&nbsp;Copyright&nbsp;2006&nbsp;Sun&nbsp;Microsystems,&nbsp;Inc.&nbsp;&nbsp;All&nbsp;Rights&nbsp;Reserved.<br />&nbsp;*<br />&nbsp;*&nbsp;Redistribution&nbsp;and&nbsp;use&nbsp;in&nbsp;source&nbsp;and&nbsp;binary&nbsp;forms,&nbsp;with&nbsp;or&nbsp;without<br />&nbsp;*&nbsp;modification,&nbsp;are&nbsp;permitted&nbsp;provided&nbsp;that&nbsp;the&nbsp;following&nbsp;conditions<br />&nbsp;*&nbsp;are&nbsp;met:<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;Redistributions&nbsp;of&nbsp;source&nbsp;code&nbsp;must&nbsp;retain&nbsp;the&nbsp;above&nbsp;copyright<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;notice,&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer.<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;Redistributions&nbsp;in&nbsp;binary&nbsp;form&nbsp;must&nbsp;reproduce&nbsp;the&nbsp;above&nbsp;copyright<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;notice,&nbsp;this&nbsp;list&nbsp;of&nbsp;conditions&nbsp;and&nbsp;the&nbsp;following&nbsp;disclaimer&nbsp;in&nbsp;the<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;documentation&nbsp;and/or&nbsp;other&nbsp;materials&nbsp;provided&nbsp;with&nbsp;the&nbsp;distribution.<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;Neither&nbsp;the&nbsp;name&nbsp;of&nbsp;Sun&nbsp;Microsystems&nbsp;nor&nbsp;the&nbsp;names&nbsp;of&nbsp;its<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contributors&nbsp;may&nbsp;be&nbsp;used&nbsp;to&nbsp;endorse&nbsp;or&nbsp;promote&nbsp;products&nbsp;derived<br />&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;this&nbsp;software&nbsp;without&nbsp;specific&nbsp;prior&nbsp;written&nbsp;permission.<br />&nbsp;*<br />&nbsp;*&nbsp;THIS&nbsp;SOFTWARE&nbsp;IS&nbsp;PROVIDED&nbsp;BY&nbsp;THE&nbsp;COPYRIGHT&nbsp;HOLDERS&nbsp;AND&nbsp;CONTRIBUTORS&nbsp;"AS<br />&nbsp;*&nbsp;IS"&nbsp;AND&nbsp;ANY&nbsp;EXPRESS&nbsp;OR&nbsp;IMPLIED&nbsp;WARRANTIES,&nbsp;INCLUDING,&nbsp;BUT&nbsp;NOT&nbsp;LIMITED&nbsp;TO,<br />&nbsp;*&nbsp;THE&nbsp;IMPLIED&nbsp;WARRANTIES&nbsp;OF&nbsp;MERCHANTABILITY&nbsp;AND&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR<br />&nbsp;*&nbsp;PURPOSE&nbsp;ARE&nbsp;DISCLAIMED.&nbsp;&nbsp;IN&nbsp;NO&nbsp;EVENT&nbsp;SHALL&nbsp;THE&nbsp;COPYRIGHT&nbsp;OWNER&nbsp;OR<br />&nbsp;*&nbsp;CONTRIBUTORS&nbsp;BE&nbsp;LIABLE&nbsp;FOR&nbsp;ANY&nbsp;DIRECT,&nbsp;INDIRECT,&nbsp;INCIDENTAL,&nbsp;SPECIAL,<br />&nbsp;*&nbsp;EXEMPLARY,&nbsp;OR&nbsp;CONSEQUENTIAL&nbsp;DAMAGES&nbsp;(INCLUDING,&nbsp;BUT&nbsp;NOT&nbsp;LIMITED&nbsp;TO,<br />&nbsp;*&nbsp;PROCUREMENT&nbsp;OF&nbsp;SUBSTITUTE&nbsp;GOODS&nbsp;OR&nbsp;SERVICES;&nbsp;LOSS&nbsp;OF&nbsp;USE,&nbsp;DATA,&nbsp;OR<br />&nbsp;*&nbsp;PROFITS;&nbsp;OR&nbsp;BUSINESS&nbsp;INTERRUPTION)&nbsp;HOWEVER&nbsp;CAUSED&nbsp;AND&nbsp;ON&nbsp;ANY&nbsp;THEORY&nbsp;OF<br />&nbsp;*&nbsp;LIABILITY,&nbsp;WHETHER&nbsp;IN&nbsp;CONTRACT,&nbsp;STRICT&nbsp;LIABILITY,&nbsp;OR&nbsp;TORT&nbsp;(INCLUDING<br />&nbsp;*&nbsp;NEGLIGENCE&nbsp;OR&nbsp;OTHERWISE)&nbsp;ARISING&nbsp;IN&nbsp;ANY&nbsp;WAY&nbsp;OUT&nbsp;OF&nbsp;THE&nbsp;USE&nbsp;OF&nbsp;THIS<br />&nbsp;*&nbsp;SOFTWARE,&nbsp;EVEN&nbsp;IF&nbsp;ADVISED&nbsp;OF&nbsp;THE&nbsp;POSSIBILITY&nbsp;OF&nbsp;SUCH&nbsp;DAMAGE.<br />&nbsp;</span><span style="color: #008000; ">*/</span><br /><br /><span style="color: #0000FF; ">import</span>&nbsp;java.io.BufferedReader;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.io.File;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.io.FileInputStream;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.io.FileOutputStream;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.io.InputStream;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.io.InputStreamReader;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.io.OutputStream;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.security.KeyStore;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.security.MessageDigest;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.security.cert.CertificateException;<br /><span style="color: #0000FF; ">import</span>&nbsp;java.security.cert.X509Certificate;<br /><br /><span style="color: #0000FF; ">import</span>&nbsp;javax.net.ssl.SSLContext;<br /><span style="color: #0000FF; ">import</span>&nbsp;javax.net.ssl.SSLException;<br /><span style="color: #0000FF; ">import</span>&nbsp;javax.net.ssl.SSLSocket;<br /><span style="color: #0000FF; ">import</span>&nbsp;javax.net.ssl.SSLSocketFactory;<br /><span style="color: #0000FF; ">import</span>&nbsp;javax.net.ssl.TrustManager;<br /><span style="color: #0000FF; ">import</span>&nbsp;javax.net.ssl.TrustManagerFactory;<br /><span style="color: #0000FF; ">import</span>&nbsp;javax.net.ssl.X509TrustManager;<br /><br /><span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">class</span>&nbsp;InstallCert&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">static</span>&nbsp;<span style="color: #0000FF; ">void</span>&nbsp;main(String[]&nbsp;args)&nbsp;<span style="color: #0000FF; ">throws</span>&nbsp;Exception&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;host;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;port;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">char</span>[]&nbsp;passphrase;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;((args.length&nbsp;==&nbsp;1)&nbsp;||&nbsp;(args.length&nbsp;==&nbsp;2))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String[]&nbsp;c&nbsp;=&nbsp;args[0].split(":");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host&nbsp;=&nbsp;c[0];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;port&nbsp;=&nbsp;(c.length&nbsp;==&nbsp;1)&nbsp;?&nbsp;443&nbsp;:&nbsp;Integer.parseInt(c[1]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;p&nbsp;=&nbsp;(args.length&nbsp;==&nbsp;1)&nbsp;?&nbsp;"changeit"&nbsp;:&nbsp;args[1];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;passphrase&nbsp;=&nbsp;p.toCharArray();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style="color: #0000FF; ">else</span>&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.println("Usage:&nbsp;java&nbsp;InstallCert&nbsp;&lt;host&gt;[:port]&nbsp;[passphrase]");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File&nbsp;file&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;File("jssecacerts");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;(file.isFile()&nbsp;==&nbsp;<span style="color: #0000FF; ">false</span>)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">char</span>&nbsp;SEP&nbsp;=&nbsp;File.separatorChar;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File&nbsp;dir&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;File(System.getProperty("java.home")&nbsp;+&nbsp;SEP&nbsp;+&nbsp;"lib"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;SEP&nbsp;+&nbsp;"security");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;File(dir,&nbsp;"jssecacerts");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;(file.isFile()&nbsp;==&nbsp;<span style="color: #0000FF; ">false</span>)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;File(dir,&nbsp;"cacerts");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Loading&nbsp;KeyStore&nbsp;"&nbsp;+&nbsp;file&nbsp;+&nbsp;"<img src="http://www.blogjava.net/Images/dot.gif"  alt="" />");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InputStream&nbsp;in&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;FileInputStream(file);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KeyStore&nbsp;ks&nbsp;=&nbsp;KeyStore.getInstance(KeyStore.getDefaultType());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ks.load(in,&nbsp;passphrase);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in.close();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SSLContext&nbsp;context&nbsp;=&nbsp;SSLContext.getInstance("TLS");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TrustManagerFactory&nbsp;tmf&nbsp;=&nbsp;TrustManagerFactory<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.getInstance(TrustManagerFactory.getDefaultAlgorithm());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmf.init(ks);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X509TrustManager&nbsp;defaultTrustManager&nbsp;=&nbsp;(X509TrustManager)&nbsp;tmf<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.getTrustManagers()[0];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SavingTrustManager&nbsp;tm&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;SavingTrustManager(defaultTrustManager);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;context.init(<span style="color: #0000FF; ">null</span>,&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;TrustManager[]&nbsp;{&nbsp;tm&nbsp;},&nbsp;<span style="color: #0000FF; ">null</span>);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SSLSocketFactory&nbsp;factory&nbsp;=&nbsp;context.getSocketFactory();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.println("Opening&nbsp;connection&nbsp;to&nbsp;"&nbsp;+&nbsp;host&nbsp;+&nbsp;":"&nbsp;+&nbsp;port&nbsp;+&nbsp;"<img src="http://www.blogjava.net/Images/dot.gif"  alt="" />");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SSLSocket&nbsp;socket&nbsp;=&nbsp;(SSLSocket)&nbsp;factory.createSocket(host,&nbsp;port);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;socket.setSoTimeout(10000);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">try</span>&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Starting&nbsp;SSL&nbsp;handshake<img src="http://www.blogjava.net/Images/dot.gif"  alt="" />");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;socket.startHandshake();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;socket.close();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("No&nbsp;errors,&nbsp;certificate&nbsp;is&nbsp;already&nbsp;trusted");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style="color: #0000FF; ">catch</span>&nbsp;(SSLException&nbsp;e)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace(System.out);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X509Certificate[]&nbsp;chain&nbsp;=&nbsp;tm.chain;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">if</span>&nbsp;(chain&nbsp;==&nbsp;<span style="color: #0000FF; ">null</span>)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Could&nbsp;not&nbsp;obtain&nbsp;server&nbsp;certificate&nbsp;chain");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BufferedReader&nbsp;reader&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;BufferedReader(<span style="color: #0000FF; ">new</span>&nbsp;InputStreamReader(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.in));<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Server&nbsp;sent&nbsp;"&nbsp;+&nbsp;chain.length&nbsp;+&nbsp;"&nbsp;certificate(s):");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageDigest&nbsp;sha1&nbsp;=&nbsp;MessageDigest.getInstance("SHA1");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageDigest&nbsp;md5&nbsp;=&nbsp;MessageDigest.getInstance("MD5");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>&nbsp;(<span style="color: #0000FF; ">int</span>&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;chain.length;&nbsp;i++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X509Certificate&nbsp;cert&nbsp;=&nbsp;chain[i];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("&nbsp;"&nbsp;+&nbsp;(i&nbsp;+&nbsp;1)&nbsp;+&nbsp;"&nbsp;Subject&nbsp;"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;cert.getSubjectDN());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("&nbsp;&nbsp;&nbsp;Issuer&nbsp;&nbsp;"&nbsp;+&nbsp;cert.getIssuerDN());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sha1.update(cert.getEncoded());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("&nbsp;&nbsp;&nbsp;sha1&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;+&nbsp;toHexString(sha1.digest()));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;md5.update(cert.getEncoded());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("&nbsp;&nbsp;&nbsp;md5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&nbsp;+&nbsp;toHexString(md5.digest()));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.println("Enter&nbsp;certificate&nbsp;to&nbsp;add&nbsp;to&nbsp;trusted&nbsp;keystore&nbsp;or&nbsp;'q'&nbsp;to&nbsp;quit:&nbsp;[1]");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;line&nbsp;=&nbsp;reader.readLine().trim();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">int</span>&nbsp;k;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">try</span>&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k&nbsp;=&nbsp;(line.length()&nbsp;==&nbsp;0)&nbsp;?&nbsp;0&nbsp;:&nbsp;Integer.parseInt(line)&nbsp;-&nbsp;1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;<span style="color: #0000FF; ">catch</span>&nbsp;(NumberFormatException&nbsp;e)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("KeyStore&nbsp;not&nbsp;changed");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X509Certificate&nbsp;cert&nbsp;=&nbsp;chain[k];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;alias&nbsp;=&nbsp;host&nbsp;+&nbsp;"-"&nbsp;+&nbsp;(k&nbsp;+&nbsp;1);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ks.setCertificateEntry(alias,&nbsp;cert);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OutputStream&nbsp;out&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;FileOutputStream("jssecacerts");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ks.store(out,&nbsp;passphrase);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;out.close();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(cert);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.println("Added&nbsp;certificate&nbsp;to&nbsp;keystore&nbsp;'jssecacerts'&nbsp;using&nbsp;alias&nbsp;'"<br />&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;alias&nbsp;+&nbsp;"'");<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">private</span>&nbsp;<span style="color: #0000FF; ">static</span>&nbsp;<span style="color: #0000FF; ">final</span>&nbsp;<span style="color: #0000FF; ">char</span>[]&nbsp;HEXDIGITS&nbsp;=&nbsp;"0123456789abcdef".toCharArray();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">private</span>&nbsp;<span style="color: #0000FF; ">static</span>&nbsp;String&nbsp;toHexString(<span style="color: #0000FF; ">byte</span>[]&nbsp;bytes)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuilder&nbsp;sb&nbsp;=&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;StringBuilder(bytes.length&nbsp;*&nbsp;3);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">for</span>&nbsp;(<span style="color: #0000FF; ">int</span>&nbsp;b&nbsp;:&nbsp;bytes)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b&nbsp;&amp;=&nbsp;0xff;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.append(HEXDIGITS[b&nbsp;&gt;&gt;&nbsp;4]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.append(HEXDIGITS[b&nbsp;&amp;&nbsp;15]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.append('&nbsp;');<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">return</span>&nbsp;sb.toString();<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">private</span>&nbsp;<span style="color: #0000FF; ">static</span>&nbsp;<span style="color: #0000FF; ">class</span>&nbsp;SavingTrustManager&nbsp;<span style="color: #0000FF; ">implements</span>&nbsp;X509TrustManager&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">private</span>&nbsp;<span style="color: #0000FF; ">final</span>&nbsp;X509TrustManager&nbsp;tm;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">private</span>&nbsp;X509Certificate[]&nbsp;chain;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SavingTrustManager(X509TrustManager&nbsp;tm)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">this</span>.tm&nbsp;=&nbsp;tm;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;X509Certificate[]&nbsp;getAcceptedIssuers()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">throw</span>&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;UnsupportedOperationException();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">void</span>&nbsp;checkClientTrusted(X509Certificate[]&nbsp;chain,&nbsp;String&nbsp;authType)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">throws</span>&nbsp;CertificateException&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">throw</span>&nbsp;<span style="color: #0000FF; ">new</span>&nbsp;UnsupportedOperationException();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">public</span>&nbsp;<span style="color: #0000FF; ">void</span>&nbsp;checkServerTrusted(X509Certificate[]&nbsp;chain,&nbsp;String&nbsp;authType)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">throws</span>&nbsp;CertificateException&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000FF; ">this</span>.chain&nbsp;=&nbsp;chain;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tm.checkServerTrusted(chain,&nbsp;authType);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />}</div><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">编译InstallCert.java，然后执行：java InstallCert hostname，比如：<br />java InstallCert www.twitter.com<br />会看到如下信息：<br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->java&nbsp;InstallCert&nbsp;www.twitter.com<br />Loading&nbsp;KeyStore&nbsp;/usr/java/jdk1.6.0_16/jre/lib/security/cacerts<img src="http://www.blogjava.net/Images/dot.gif"  alt="" /><br />Opening&nbsp;connection&nbsp;to&nbsp;www.twitter.com:443<img src="http://www.blogjava.net/Images/dot.gif"  alt="" /><br />Starting&nbsp;SSL&nbsp;handshake<img src="http://www.blogjava.net/Images/dot.gif"  alt="" /><br /><br />javax.net.ssl.SSLHandshakeException:&nbsp;sun.security.validator.ValidatorException:&nbsp;PKIX&nbsp;path&nbsp;building&nbsp;failed:&nbsp;sun.security.provider.certpath.SunCertPathBuilderException:&nbsp;unable&nbsp;to&nbsp;find&nbsp;valid&nbsp;certification&nbsp;path&nbsp;to&nbsp;requested&nbsp;target<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:150)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1476)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:174)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:168)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:846)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:106)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:495)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:433)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:815)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;InstallCert.main(InstallCert.java:63)<br />Caused&nbsp;by:&nbsp;sun.security.validator.ValidatorException:&nbsp;PKIX&nbsp;path&nbsp;building&nbsp;failed:&nbsp;sun.security.provider.certpath.SunCertPathBuilderException:&nbsp;unable&nbsp;to&nbsp;find&nbsp;valid&nbsp;certification&nbsp;path&nbsp;to&nbsp;requested&nbsp;target<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:221)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:145)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.security.validator.Validator.validate(Validator.java:203)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:172)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;InstallCert$SavingTrustManager.checkServerTrusted(InstallCert.java:158)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(SSLContextImpl.java:320)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:839)<br />&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.blogjava.net/Images/dot.gif"  alt="" />&nbsp;7&nbsp;more<br />Caused&nbsp;by:&nbsp;sun.security.provider.certpath.SunCertPathBuilderException:&nbsp;unable&nbsp;to&nbsp;find&nbsp;valid&nbsp;certification&nbsp;path&nbsp;to&nbsp;requested&nbsp;target<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:236)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;java.security.cert.CertPathBuilder.build(CertPathBuilder.java:194)<br />&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:216)<br />&nbsp;&nbsp;&nbsp;&nbsp;<img src="http://www.blogjava.net/Images/dot.gif"  alt="" />&nbsp;13&nbsp;more<br /><br />Server&nbsp;sent&nbsp;2&nbsp;certificate(s):<br /><br />&nbsp;1&nbsp;Subject&nbsp;CN=www.twitter.com,&nbsp;O=example.com,&nbsp;C=US<br />&nbsp;&nbsp;&nbsp;Issuer&nbsp;&nbsp;CN=Certificate&nbsp;Shack,&nbsp;O=example.com,&nbsp;C=US<br />&nbsp;&nbsp;&nbsp;sha1&nbsp;&nbsp;&nbsp;&nbsp;2e&nbsp;7f&nbsp;76&nbsp;9b&nbsp;52&nbsp;91&nbsp;09&nbsp;2e&nbsp;5d&nbsp;8f&nbsp;6b&nbsp;61&nbsp;39&nbsp;2d&nbsp;5e&nbsp;06&nbsp;e4&nbsp;d8&nbsp;e9&nbsp;c7&nbsp;<br />&nbsp;&nbsp;&nbsp;md5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dd&nbsp;d1&nbsp;a8&nbsp;03&nbsp;d7&nbsp;6c&nbsp;4b&nbsp;11&nbsp;a7&nbsp;3d&nbsp;74&nbsp;28&nbsp;89&nbsp;d0&nbsp;67&nbsp;54&nbsp;<br /><br />&nbsp;2&nbsp;Subject&nbsp;CN=Certificate&nbsp;Shack,&nbsp;O=example.com,&nbsp;C=US<br />&nbsp;&nbsp;&nbsp;Issuer&nbsp;&nbsp;CN=Certificate&nbsp;Shack,&nbsp;O=example.com,&nbsp;C=US<br />&nbsp;&nbsp;&nbsp;sha1&nbsp;&nbsp;&nbsp;&nbsp;fb&nbsp;58&nbsp;a7&nbsp;03&nbsp;c4&nbsp;4e&nbsp;3b&nbsp;0e&nbsp;e3&nbsp;2c&nbsp;40&nbsp;2f&nbsp;87&nbsp;64&nbsp;13&nbsp;4d&nbsp;df&nbsp;e1&nbsp;a1&nbsp;a6&nbsp;<br />&nbsp;&nbsp;&nbsp;md5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;72&nbsp;a0&nbsp;95&nbsp;43&nbsp;7e&nbsp;41&nbsp;88&nbsp;18&nbsp;ae&nbsp;2f&nbsp;6d&nbsp;98&nbsp;01&nbsp;2c&nbsp;89&nbsp;68&nbsp;<br /><br />Enter&nbsp;certificate&nbsp;to&nbsp;add&nbsp;to&nbsp;trusted&nbsp;keystore&nbsp;or&nbsp;'q'&nbsp;to&nbsp;quit:&nbsp;[1]</div><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="background-color: #cccccc;"><br /></span>输入1，回车，然后会在当前的目录下产生一个名为&#8220;<strong>ssecacerts&#8221;</strong>的证书。</p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;">将证书拷贝到<strong><span style="color: #ff0000;">$JAVA_HOME/jre/lib/security</span></strong>目录下，或者通过以下方式：<br /><strong><span style="color: #ff0000;">System.setProperty("javax.net.ssl.trustStore", "你的jssecacerts证书路径");</span></strong></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br /></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><br /><strong><span style="color: #ff0000;">注意：因为是静态加载，所以要重新启动你的Web Server，证书才能生效。</span></strong></p><p style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px; background-color: #ffffff;"><span style="background-color: #cccccc;"><br />试了以上的方法，后来发现还不行。最后突然心血来潮：我把Myeclipse关闭，直接启动Tomcat，然后运行，居然就可以了。具体原因没有找到。估计是<br />我的Myeclipse引用的JDK引用不对。后来就没有具体找原因了。<br /><br /></span></p><img src ="http://www.blogjava.net/yxhxj2006/aggbug/427988.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-10-30 15:06 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/10/30/427988.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>常用的MySQL语句写法</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/08/09/426700.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Sun, 09 Aug 2015 15:31:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/08/09/426700.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/426700.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/08/09/426700.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/426700.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/426700.html</trackback:ping><description><![CDATA[<span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">MySQL</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">的</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">SQL</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">语句写法，除了那些基本的之外，还有一些也算比较常用的，这里记录下来，以便以后查找。<br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">好记性不如烂笔头，这话说的太有道理了，一段时间不写它，还真容易忘记。大家不要纠结这些</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">SQL</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">语句包含的业务或是其它问题，本文只是一篇笔记而已。</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">将数据从</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">T1</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">表导入到</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">T2</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">表</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">INSERT</span>&nbsp;<span style="color: #0000ff;">INTO</span>&nbsp;T2&nbsp;(C1,C2)&nbsp;<span style="color: #0000ff;">SELECT</span>&nbsp;C1,C2&nbsp;<span style="color: #0000ff;">FROM</span>&nbsp;T1&nbsp;<span style="color: #ff0000;">[</span><span style="color: #ff0000;">WHERE&nbsp;C1&nbsp;=&nbsp;XX&nbsp;AND&nbsp;C2&nbsp;=&nbsp;XX&nbsp;ORDER&nbsp;BY&nbsp;C1</span><span style="color: #ff0000;">]</span></div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">使用</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">T2</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">表的</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">NAME</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">来更新</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">T1</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">表的</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">NAME</span><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">UPDATE</span>&nbsp;T1&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;A,&nbsp;T2&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;B&nbsp;<span style="color: #0000ff;">SET</span>&nbsp;A.NAME&nbsp;<span style="color: #808080;">=</span>&nbsp;B.NAME&nbsp;<span style="color: #0000ff;">WHERE</span>&nbsp;A.TID&nbsp;<span style="color: #808080;">=</span>&nbsp;B.ID</div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">两表的关联更新</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">UPDATE</span>&nbsp;T_ROLE_USER&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;A,<br />&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T_USER<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">WHERE</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DEPARTID&nbsp;<span style="color: #808080;">IN</span>&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T_DEPART<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">WHERE</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LENGTH(ORG_CODE)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">9</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />)&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;B<br /><span style="color: #0000ff;">SET</span>&nbsp;A.ROLEID&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">123456</span><span style="color: #ff0000;">'</span><br /><span style="color: #0000ff;">WHERE</span><br />&nbsp;&nbsp;&nbsp;&nbsp;A.USERID&nbsp;<span style="color: #808080;">=</span>&nbsp;B.ID</div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">自己和自己关联更新</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">UPDATE</span>&nbsp;T_DEPART&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;A,<br />&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUBSTRING</span>(ORG_CODE,&nbsp;<span style="color: #800000; font-weight: bold;">1</span>,&nbsp;<span style="color: #800000; font-weight: bold;">6</span>)&nbsp;ORG_CODE<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T_DEPART<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">WHERE</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LENGTH(ORG_CODE)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">8</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080;">AND</span>&nbsp;PARENT_DEPART_ID&nbsp;<span style="color: #0000ff;">IS</span>&nbsp;<span style="color: #808080;">NOT</span>&nbsp;<span style="color: #0000ff;">NULL</span><br />)&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;B<br /><span style="color: #0000ff;">SET</span>&nbsp;A.PARENT_DEPART_ID&nbsp;<span style="color: #808080;">=</span>&nbsp;B.ID<br /><span style="color: #0000ff;">WHERE</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUBSTRING</span>(A.ORG_CODE,&nbsp;<span style="color: #800000; font-weight: bold;">1</span>,&nbsp;<span style="color: #800000; font-weight: bold;">6</span>)&nbsp;<span style="color: #808080;">=</span>&nbsp;B.ORG_CODE</div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">两表关联删除，将删除两表中有关联</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">ID</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">并且</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">T2</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">表</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">NAME</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">为空的两表记录</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">DELETE</span>&nbsp;A,B&nbsp;<span style="color: #0000ff;">FROM</span>&nbsp;T1&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;A&nbsp;<span style="color: #ff00ff;">LEFT</span>&nbsp;<span style="color: #0000ff;">JOIN</span>&nbsp;T2&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;B&nbsp;<span style="color: #0000ff;">ON</span>&nbsp;A.TID&nbsp;<span style="color: #808080;">=</span>&nbsp;B.ID&nbsp;<span style="color: #0000ff;">WHERE</span>&nbsp;B.NAME&nbsp;<span style="color: #0000ff;">IS</span>&nbsp;<span style="color: #0000ff;">NULL</span></div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">将统计结果插入到表</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">INSERT</span>&nbsp;<span style="color: #0000ff;">INTO</span>&nbsp;SE_STAT_ORG&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;RECORD_DATE,<br />&nbsp;&nbsp;&nbsp;&nbsp;ORG_ID,<br />&nbsp;&nbsp;&nbsp;&nbsp;ORG_NAME,<br />&nbsp;&nbsp;&nbsp;&nbsp;SIGN_CONT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;SIGN_ARRI_CONT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;SIGN_CONT_MONEY,<br />&nbsp;&nbsp;&nbsp;&nbsp;SIGN_ARRI_CONT_MONEY,<br />&nbsp;&nbsp;&nbsp;&nbsp;TOTAL_ARRI_CONT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;TOTAL_ARRI_MONEY,<br />&nbsp;&nbsp;&nbsp;&nbsp;PUBLISH_TOTAL_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;PROJECT_COUNT<br />)&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080;">*</span><br /><span style="color: #0000ff;">FROM</span><br />&nbsp;&nbsp;&nbsp;&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-06-09</span><span style="color: #ff0000;">'</span>&nbsp;RECORD_DATE,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PARENT_ORG_ID,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PARENT_ORG_NAME,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(SIGN_CONT_COUNT)&nbsp;SIGN_CONT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(SIGN_ARRI_CONT_COUNT)&nbsp;SIGN_ARRI_CONT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(SIGN_CONT_MONEY)&nbsp;SIGN_CONT_MONEY,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(SIGN_ARRI_CONT_MONEY)&nbsp;SIGN_ARRI_CONT_MONEY,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(TOTAL_ARRI_CONT_COUNT)&nbsp;TOTAL_ARRI_CONT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(TOTAL_ARRI_MONEY)&nbsp;TOTAL_ARRI_MONEY,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(PUBLISH_TOTAL_COUNT)&nbsp;PUBLISH_TOTAL_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(PROJECT_COUNT)&nbsp;PROJECT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span>&nbsp;SE_STAT_USER<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">WHERE</span>&nbsp;DATE_FORMAT(RECORD_DATE,&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">%Y-%m-%d</span><span style="color: #ff0000;">'</span>)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-06-09</span><span style="color: #ff0000;">'</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">GROUP</span>&nbsp;<span style="color: #0000ff;">BY</span>&nbsp;PARENT_ORG_ID<br />&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;M</div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">三表关联更新</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">UPDATE</span>&nbsp;SE_STAT_USER&nbsp;A,<br />&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">USER_ID</span>,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(INVEST_ORG_COUNT&nbsp;<span style="color: #808080;">+</span>&nbsp;FINANCIAL_ORG_COUNT&nbsp;<span style="color: #808080;">+</span>&nbsp;INTERMEDIARY_ORG_COUNT&nbsp;<span style="color: #808080;">+</span>&nbsp;ENTERPRISE_COUNT)&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;COMMON_COUNT<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span>&nbsp;SE_STAT_USER<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">WHERE</span>&nbsp;DATE_FORMAT(RECORD_DATE,&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">%Y-%m-%d</span><span style="color: #ff0000;">'</span>)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-06-09</span><span style="color: #ff0000;">'</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">GROUP</span>&nbsp;<span style="color: #0000ff;">BY</span>&nbsp;<span style="color: #ff00ff;">USER_ID</span><br />)&nbsp;B,<br />&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">USER_ID</span>,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">SUM</span>(ESTABLISH_COUNT&nbsp;<span style="color: #808080;">+</span>&nbsp;STOCK_COUNT&nbsp;<span style="color: #808080;">+</span>&nbsp;MERGER_COUNT&nbsp;<span style="color: #808080;">+</span>&nbsp;ACHIEVE_COUNT)&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;PROJECT_COUNT<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span>&nbsp;SE_STAT_USER<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">WHERE</span>&nbsp;DATE_FORMAT(RECORD_DATE,&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">%Y-%m-%d</span><span style="color: #ff0000;">'</span>)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-06-09</span><span style="color: #ff0000;">'</span><br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">GROUP</span>&nbsp;<span style="color: #0000ff;">BY</span>&nbsp;<span style="color: #ff00ff;">USER_ID</span><br />)&nbsp;C<br /><span style="color: #0000ff;">SET</span>&nbsp;A.COMMON_COUNT&nbsp;<span style="color: #808080;">=</span>&nbsp;B.COMMON_COUNT,&nbsp;A.PROJECT_COUNT&nbsp;<span style="color: #808080;">=</span>&nbsp;C.PROJECT_COUNT<br /><span style="color: #0000ff;">WHERE</span>&nbsp;A.<span style="color: #ff00ff;">USER_ID</span>&nbsp;<span style="color: #808080;">=</span>&nbsp;B.<span style="color: #ff00ff;">USER_ID</span><br /><span style="color: #808080;">AND</span>&nbsp;A.<span style="color: #ff00ff;">USER_ID</span>&nbsp;<span style="color: #808080;">=</span>&nbsp;C.<span style="color: #ff00ff;">USER_ID</span><br /><span style="color: #808080;">AND</span>&nbsp;DATE_FORMAT(A.RECORD_DATE,&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">%Y-%m-%d</span><span style="color: #ff0000;">'</span>)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-06-09</span><span style="color: #ff0000;">'</span></div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">带条件的关联更新</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">UPDATE</span>&nbsp;SE_STAT_USER&nbsp;A,<br />&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;P.CHANNEL,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff00ff;">COUNT</span>(P.CONT_ID)&nbsp;<span style="color: #0000ff;">AS</span>&nbsp;CONT_COUNT,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;C.CUST_MGR_ID<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">SELECT</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CHANNEL,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CONT_ID<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">FROM</span>&nbsp;SK_PROJECT<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">WHERE</span>&nbsp;PROJECT_STATUS&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">6</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080;">AND</span>&nbsp;DATE_FORMAT(AUDIT_TIME,&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">%Y-%m-%d</span><span style="color: #ff0000;">'</span>)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-06-11</span><span style="color: #ff0000;">'</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)&nbsp;p<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">INNER</span>&nbsp;<span style="color: #0000ff;">JOIN</span>&nbsp;SE_CONTRACT&nbsp;C&nbsp;<span style="color: #0000ff;">ON</span>&nbsp;P.CONT_ID&nbsp;<span style="color: #808080;">=</span>&nbsp;C.CONT_ID<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">GROUP</span>&nbsp;<span style="color: #0000ff;">BY</span>&nbsp;P.CHANNEL,&nbsp;C.CUST_MGR_ID<br />)&nbsp;B<br /><span style="color: #0000ff;">SET</span><br />&nbsp;&nbsp;&nbsp;&nbsp;A.STOCK_COUNT&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff00ff;">CASE</span>&nbsp;<span style="color: #0000ff;">WHEN</span>&nbsp;B.CHANNEL&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">2</span>&nbsp;<span style="color: #0000ff;">THEN</span>&nbsp;B.CONT_COUNT&nbsp;<span style="color: #0000ff;">ELSE</span>&nbsp;<span style="color: #800000; font-weight: bold;">0</span>&nbsp;<span style="color: #0000ff;">END</span>,<br />&nbsp;&nbsp;&nbsp;&nbsp;A.ESTABLISH_COUNT&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff00ff;">CASE</span>&nbsp;<span style="color: #0000ff;">WHEN</span>&nbsp;B.CHANNEL&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">3</span>&nbsp;<span style="color: #0000ff;">THEN</span>&nbsp;B.CONT_COUNT&nbsp;<span style="color: #0000ff;">ELSE</span>&nbsp;<span style="color: #800000; font-weight: bold;">0</span>&nbsp;<span style="color: #0000ff;">END</span>,<br />&nbsp;&nbsp;&nbsp;&nbsp;A.ACHIEVE_COUNT&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff00ff;">CASE</span>&nbsp;<span style="color: #0000ff;">WHEN</span>&nbsp;B.CHANNEL&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">4</span>&nbsp;<span style="color: #0000ff;">THEN</span>&nbsp;B.CONT_COUNT&nbsp;<span style="color: #0000ff;">ELSE</span>&nbsp;<span style="color: #800000; font-weight: bold;">0</span>&nbsp;<span style="color: #0000ff;">END</span>,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;A.BRAND_COUNT&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff00ff;">CASE</span>&nbsp;<span style="color: #0000ff;">WHEN</span>&nbsp;B.CHANNEL&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">5</span>&nbsp;<span style="color: #0000ff;">THEN</span>&nbsp;B.CONT_COUNT&nbsp;<span style="color: #0000ff;">ELSE</span>&nbsp;<span style="color: #800000; font-weight: bold;">0</span>&nbsp;<span style="color: #0000ff;">END</span>,<br />&nbsp;&nbsp;&nbsp;&nbsp;A.MERGER_COUNT&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff00ff;">CASE</span>&nbsp;<span style="color: #0000ff;">WHEN</span>&nbsp;B.CHANNEL&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #800000; font-weight: bold;">6</span>&nbsp;<span style="color: #0000ff;">THEN</span>&nbsp;B.CONT_COUNT&nbsp;<span style="color: #0000ff;">ELSE</span>&nbsp;<span style="color: #800000; font-weight: bold;">0</span>&nbsp;<span style="color: #0000ff;">END</span><br /><span style="color: #0000ff;">WHERE</span><br />&nbsp;&nbsp;&nbsp;&nbsp;A.<span style="color: #ff00ff;">USER_ID</span>&nbsp;<span style="color: #808080;">=</span>&nbsp;B.CUST_MGR_ID<br /><span style="color: #808080;">AND</span>&nbsp;DATE_FORMAT(A.RECORD_DATE,&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">%Y-%m-%d</span><span style="color: #ff0000;">'</span>)&nbsp;<span style="color: #808080;">=</span>&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">2012-06-11</span><span style="color: #ff0000;">'</span></div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">加索引</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">ALTER</span>&nbsp;<span style="color: #0000ff;">TABLE</span>&nbsp;PROJECT&nbsp;<span style="color: #0000ff;">ADD</span>&nbsp;<span style="color: #0000ff;">INDEX</span>&nbsp;INDEX_USER_ID&nbsp;(<span style="color: #ff00ff;">USER_ID</span>),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">ADD</span>&nbsp;<span style="color: #0000ff;">INDEX</span>&nbsp;INDEX_PROJECT_STATUS&nbsp;(PROJECT_STATUS);</div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">删除列</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">ALTER</span>&nbsp;<span style="color: #0000ff;">TABLE</span>&nbsp;PROJECT&nbsp;<span style="color: #0000ff;">DROP</span>&nbsp;<span style="color: #0000ff;">COLUMN</span>&nbsp;PROJECT_STATUS,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">DROP</span>&nbsp;<span style="color: #0000ff;">COLUMN</span>&nbsp;EXPECT_RETURN,<span style="color: #0000ff;">DROP</span>&nbsp;<span style="color: #0000ff;">COLUMN</span>&nbsp;CURRENCY;</div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">增加列</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">ALTER</span>&nbsp;<span style="color: #0000ff;">TABLE</span>&nbsp;PROJECT&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">ADD</span>&nbsp;<span style="color: #0000ff;">COLUMN</span>&nbsp;DICT_ID&nbsp;<span style="font-weight: bold;">INT</span>&nbsp;<span style="color: #0000ff;">DEFAULT</span>&nbsp;<span style="color: #0000ff;">NULL</span>&nbsp;COMMENT&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">xxx</span><span style="color: #ff0000;">'</span>&nbsp;AFTER&nbsp;PROJECT_SITE,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">ADD</span>&nbsp;<span style="color: #0000ff;">COLUMN</span>&nbsp;INTRODUCE&nbsp;<span style="font-weight: bold;">TEXT</span>&nbsp;<span style="color: #0000ff;">DEFAULT</span>&nbsp;<span style="color: #0000ff;">NULL</span>&nbsp;COMMENT&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">xx</span><span style="color: #ff0000;">'</span>&nbsp;AFTER&nbsp;DICT_ID,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">ADD</span>&nbsp;<span style="color: #0000ff;">COLUMN</span>&nbsp;STAGE&nbsp;<span style="font-weight: bold;">INT</span>&nbsp;<span style="color: #0000ff;">DEFAULT</span>&nbsp;<span style="color: #0000ff;">NULL</span>&nbsp;COMMENT&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">xx</span><span style="color: #ff0000;">'</span>&nbsp;AFTER&nbsp;ID,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">ADD</span>&nbsp;<span style="color: #0000ff;">COLUMN</span>&nbsp;ATTACH_URI&nbsp;<span style="font-weight: bold;">VARCHAR</span>(<span style="color: #800000; font-weight: bold;">8</span>)&nbsp;<span style="color: #0000ff;">DEFAULT</span>&nbsp;<span style="color: #0000ff;">NULL</span>&nbsp;COMMENT&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">xxx</span><span style="color: #ff0000;">'</span>&nbsp;AFTER&nbsp;INTRODUCE;</div><span style="color: #4b4b4b; line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';"><br /></span><span style="color: #4b4b4b; font-size: 13px; line-height: 19.5px; font-family: 宋体;">&nbsp; &nbsp;&nbsp;</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">修改列，一般用</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">MODIFY</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">修改数据类型，</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 'Courier New';">CHANGE</span><span style="line-height: 19.5px; font-size: 10.5pt; font-family: 宋体;">修改列名</span><br style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px;" /><div style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 1078.97px; word-break: break-all; background-color: #eeeeee;"><span style="color: #0000ff;">ALTER</span>&nbsp;<span style="color: #0000ff;">TABLE</span>&nbsp;PROJECT&nbsp;<span style="color: #0000ff;">CHANGE</span>&nbsp;DICT_ID&nbsp;DICT_ID1&nbsp;<span style="font-weight: bold;">INT</span>&nbsp;<span style="color: #808080;">NOT</span>&nbsp;<span style="color: #0000ff;">NULL</span>,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">MODIFY</span>&nbsp;PROJECT_STATUS&nbsp;<span style="font-weight: bold;">TINYINT</span>&nbsp;<span style="color: #808080;">NOT</span>&nbsp;<span style="color: #0000ff;">NULL</span>&nbsp;COMMENT&nbsp;<span style="color: #ff0000;">'</span><span style="color: #ff0000;">xxx</span><span style="color: #ff0000;">'</span>;</div><img src ="http://www.blogjava.net/yxhxj2006/aggbug/426700.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-08-09 23:31 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/08/09/426700.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>程序员必看的书</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/06/13/425662.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Fri, 12 Jun 2015 16:03:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/06/13/425662.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/425662.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/06/13/425662.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/425662.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/425662.html</trackback:ping><description><![CDATA[<p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">做为一名程序员，如果你只顾得写代码，那是不行的，要抽出一下时间来丰富自己的知识，多看看书，在这里我将为程序员们推荐一些不错的书。能够给程序员们带来帮助。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">大数据时代</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a5bd00010d2903120426.jpg" alt="5487a5bd00010d2903120426" width="312" height="426" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《大数据时代》是国外大数据研究的先河之作，本书作者维克托&#8226;迈尔&#8226;舍恩伯格被誉为"大数据商业应用第一人"，拥有在哈佛大学、牛津大学、耶鲁大学和新加坡国立大学等多个互联网研究重镇任教的经历，早在2010年就在《经济学人》上发布了长达14页对大数据应用的前瞻性研究。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">维克托&#8226;迈尔&#8226;舍恩伯格在书中前瞻性地指出，大数据带来的信息风暴正在变革我们的生活、工作和思维，大数据开启了一次重大的时代转型，并用三个部分讲述了大数据时代的思维变革、商业变革和管理变革。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">维克托最具洞见之处在于，他明确指出，大数据时代最大的转变就是，放弃对因果关系的渴求，而取而代之关注相关关系。也就是说只要知道"是什么"，而不需要知道"为什么"。这就颠覆了千百年来人类的思维惯例，对人类的认知和与世界交流的方式提出了全新的挑战。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">　淘宝技术这十年</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a5c800013dae03030438.jpg" alt="5487a5c800013dae03030438" width="303" height="438" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《淘宝技术这十年》内容简介：任何网站的发展都不是一蹴而就的。它在发展过程中会遇到各种各样的问题和业务带来的压力。正是这些问题和压力推动着技术的进步和发展，而技术的发展反过来又会促进业务的更大提升。如今淘宝网的流量排名已是全球前15名、国内前3名，其系统服务器也从一台发展到万台以上。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《淘宝技术这十年》从工程师的角度讲述淘宝这个超大规模互联网系统的成长历程，及其所有主动和被动的技术变革的前因后果。书中有幕后故事、产品经验、架构演进、技术启蒙，也有大牛成长、业内八卦、失败案例、励志故事。《淘宝技术这十年》文风流畅，有技术人员特有的幽默感;内容积极正面，有现场感，全部是作者亲身经历。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">白帽子讲Web安全</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a7b90001fa2303030438.jpg" alt="5487a7b90001fa2303030438" width="303" height="438" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《白帽子讲Web安全》内容简介：在互联网时代，数据安全与个人隐私受到了前所未有的挑战，各种新奇的攻击技术层出不穷。如何才能更好地保护我们的数据?《白帽子讲Web安全》将带你走进Web安全的世界，让你了解Web安全的方方面面。黑客不再变得神秘，攻击技术原来我也可以会，小网站主自己也能找到正确的安全道路。大公司是怎么做安全的，为什么要选择这样的方案呢?你能在《白帽子讲Web安全》中找到答案。详细的剖析，让你不仅能"知其然"，更能"知其所以然"。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">重构:改善既有代码的设计</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a7c400010cce04000400.jpg" alt="5487a7c400010cce04000400" width="400" height="400" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《重构：改善既有代码的设计》清晰地揭示了重构的过程，解释了重构的原理和最佳实践方式，并给出了何时以及何地应该开始挖掘代码以求改善。书中给出了70多个可行的重构，每个重构都介绍了一种经过验证的代码变换手法的动机和技术。《重构：改善既有代码的设计》提出的重构准则将帮助你一次一小步地修改你的代码，从而减少了开发过程中的风险。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《重构：改善既有代码的设计》适合软件开发人员、项目管理人员等阅读，也可作为高等院校计算机及相关专业师生的参考读物。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;">代码整洁之道</strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/5487a7cf000167fd03240408.jpg" alt="5487a7cf000167fd03240408" width="324" height="408" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">软件质量，不但依赖于架构及项目管理，而且与代码质量紧密相关。这一点，无论是敏捷开发流派还是传统开发流派，都不得不承认。《代码整洁之道》提出一种观念：代码质量与其整洁度成正比。干净的代码，既在质量上较为可靠，也为后期维护、升级奠定了良好基础。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">作为编程领域的佼佼者，《代码整洁之道》作者给出了一系列行之有效的整洁代码操作实践。这些实践在《代码整洁之道》中体现为一条条规则(或称"启示")，并辅以来自现实项目的正、反两面的范例。只要遵循这些规则，就能编写出干净的代码，从而有效提升代码质量。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《代码整洁之道》阅读对象为一切有志于改善代码质量的程序员及技术经理。书中介绍的规则均来自作者多年的实践经验，涵盖从命名到重构的多个编程方面，虽为一"家"之言，然诚有可资借鉴的价值。<br /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">设计模式之禅 (第2版)</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><br /></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549ccdfa00018b6503630363.jpg" alt="549ccdfa00018b6503630363" width="363" height="363" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">　　本书是设计模式领域公认的3本经典著作之一，"极具趣味，容易理解，但讲解又极为严谨和透彻"是本书的写作风格和方法的最大特点。第1版2010年出版，畅销至今，广受好评，是该领域的里程碑著作。深刻解读6大设计原则和28种设计模式的准确定义、应用方法和最佳实践，全方位比较各种同类模式之间的异同，详细讲解将不同的模式组合使用的方法。第2版在第1版的基础上有两方面的改进，一方面结合读者的意见和建议对原有内容中的瑕疵进行了修正和完善，另一方面增加了4种新的设计模式，希望这一版能为广大程序员们奉上一场更加完美的设计模式盛宴!</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">程序员修炼之道</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce040001ee3b03150420.jpg" alt="549cce040001ee3b03150420" width="315" height="420" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">　　《程序员修炼之道》由一系列的独立的部分组成，涵盖的主题从个人责任、职业发展，直到用于使代码保持灵活、并且易于改编和复用的各种架构技术。利用许多富有娱乐性的奇闻轶事、有思想性的例子以及有趣的类比，全面阐释了软件开发的许多不同方面的最佳实践和重大陷阱。无论你是初学者，是有经验的程序员，还是软件项目经理，本书都适合你阅读。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">平台战略:正在席卷全球的商业模式革命</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce0e00012ad003120426.jpg" alt="549cce0e00012ad003120426" width="312" height="426" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《平台战略:正在席卷全球的商业模式革命》内容简介：平台商业模式的精髓，在于打造一个完善的、成长潜能强大的"生态圈"。它拥有独树一帜的精密规范和机制系统，能有效激励多方群体之间互动，达成平台企业的愿景。纵观全球许多重新定义产业架构的企业，我们往往就会发现它们成功的关键&#8212;&#8212;建立起良好的"平台生态圈"，连接两个以上群体，弯曲、打碎了既有的产业链。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">平台生态圈里的一方群体，一旦因为需求增加而壮大，另一方群体的需求也会随之增长。如此一来，一个良性循环机制便建立了，通过此平台交流的各方也会促进对方无限增长。而通过平台模式达到战略目的，包括规模的壮大和生态圈的完善，乃至对抗竞争者，甚至是拆解产业现状、重塑市场格局。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">互联网创业启示录</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce170001475203030438.jpg" alt="549cce170001475203030438" width="303" height="438" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《互联网创业启示录》是一部互联网公司的创业指南，内容涉及网站创业的现状和机遇、创业公司价值、平台选择、工具和群组、资金的筹集、管理和盈利、社会化媒体环境、行动执行管理、开发人员方法论和工作效率、创始人的角色等方面，既有纲领和指导性理论，又有具体操作方法。书中大量对互联网创业成功人士的访谈介绍，以及创业公司的成功案例，更可以作为初次创业者的良好借鉴。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">《互联网创业启示录》主要写给想自己创业的程序员，但同样适合非技术人员，适合网络创业者、大学生创业者、网络营销人员及一切有志创业者。做网络不一定要懂技术，互联网的成功是可以借鉴和延伸的!</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">程序员健康指南</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/549cce2600015a5003600369.jpg" alt="549cce2600015a5003600369" width="360" height="369" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书是为程序员量身制作的健康指南，针对头痛、眼部疲劳、背部疼痛和手腕疼痛等常见的问题，简要介绍了其成因、测试方法，并列出了每天的行动计划，从运动、饮食等方面给出详细指导，帮助程序员在不改变工作方式的情况下轻松拥有健康。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书适合程序员、长期伏案工作的其他人群以及所有关心健康的人士阅读。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">结网@改变世界的互联网产品经理</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f680001268603060435.jpg" alt="54aa4f680001268603060435" width="306" height="435" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书以如何创建、发布、推广互联网产品为主线，介绍了互联网产品经理的工作内容以及应对每一部分工作所需的方法和工具。为用户创造价值是产品经理的第一要务，产品经理的工作是围绕用户及具体任务展开的，本书丰富的案例和透彻的分析道出了从发现用户到最终满足用户这一过程背后的玄机。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书面向现在正在从事及未来将要从事互联网相关工作的创业者和产品经理，也可以作为互联网产品策划人员或相关专业学生的参考书。新版完善了各章节，增加了优雅降级等内容，读者也可从中更深地去感受一名产品经理的感悟。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">程序员面试逻辑题解析</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f7800016ca403240408.jpg" alt="54aa4f7800016ca403240408" width="324" height="408" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">程序员面试逻辑题解析》共分为3个部分。第一部分从有趣且锻炼头脑的谜题入手，继而给出解题思路和详细答案，更有"热身问题"给大家提供充分的思考空间。第二部分综合了不同类型的谜题，如数独、调度问题及概率题等。神秘的第三部分带领大家不断历险，开动脑筋，解决大量密码及银行账户等方面的问题。几十道简洁的小谜题不仅充分锻炼了我们的思维方式，更为提高面试成功率奠定了基础。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;">&nbsp; &nbsp; 《程序员面试逻辑题解析》不仅适合程序员阅读，更是谜题爱好者的饕餮盛宴。</strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">程序员，你伤不起</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f8d000171b703060435.jpg" alt="54aa4f8d000171b703060435" width="306" height="435" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书是作者博客文章的精选集。是作者作为老牌程序员、现在的IT 创业者15 年软件开发生涯的心路历程和经验总结。涉及程序人生、开发经验、职业规划、创业心得。对任何的软件开发者和IT 从业人员都有借鉴价值。作者语言风趣幽默，读起来津津有味。字里行间充满了不屈不挠的码农正能量。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">像程序员一样思考</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4f9800013e1e03270405.jpg" alt="54aa4f9800013e1e03270405" width="327" height="405" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">编程的真正挑战不是学习一种语言的语法，而是学习创造性地解决问题，从而构建美妙的应用。《像程序员一样思考》分析了程序员解决问题的方法，并且教授你其他图书所忽略的一种能力，即如何像程序员一样思考。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">全书分为8章。第1章通对几个经典的算法问题切入，概括了问题解决的基本技巧和步骤。第2章通过实际编写C++代码来解决几个简单的问题，从而让读者进一步体会到问题解决的思路和应用。第3到7章是书中的主体部分，分别探讨了用数组、指针和动态内存、类、递归和代码复用来解决问题的途径和实际应用。最后，第8章从培养程序员思维的角度，进行了总结和概括，告诉读者如何才能像程序员一样思考。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; font-size: large;"><span style="box-sizing: border-box; color: #ff0000;">编写可读代码的艺术</span></span></strong></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;"><span style="box-sizing: border-box; color: #14191e;"><strong style="box-sizing: border-box;"><img src="http://www.w3cschool.cc/wp-content/uploads/2015/03/54aa4fbf0001a7c103180417.jpg" alt="54aa4fbf0001a7c103180417" width="318" height="417" style="box-sizing: border-box; border: 0px; vertical-align: middle; margin: 5px 0px; display: block; max-width: 100%; height: auto;" /></strong></span></p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">细节决定成败，思路清晰、言简意赅的代码让程序员一目了然;而格式凌乱、拖沓冗长的代码让程序员一头雾水。除了可以正确运行以外，优秀的代码必须具备良好的可读性，编写的代码要使其他人能在最短的时间内理解才行。本书旨在强调代码对人的友好性和可读性。</p><p style="box-sizing: border-box; margin: 0px 0px 25px; color: #555555; font-family: 'Microsoft Yahei', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 27px; background-color: #ffffff;">本书关注编码的细节，总结了很多提高代码可读性的小技巧，看似都微不足道，但是对于整个软件系统的开发而言，它们与宏观的架构决策、设计思想、指导原则同样重要。编码不仅仅只是一种技术，也是一门艺术，编写可读性高的代码尤其如此。如果你要成为一位优秀的程序员，要想开发出高质量的软件系统，必须从细处着手，做到内外兼修，本书将为你提供有效的指导。</p><img src ="http://www.blogjava.net/yxhxj2006/aggbug/425662.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-06-13 00:03 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/06/13/425662.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle分析函数入门</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425032.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Tue, 12 May 2015 16:46:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425032.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/425032.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425032.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/425032.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/425032.html</trackback:ping><description><![CDATA[<h1><a id="cb_post_title_url" href="http://www.cnblogs.com/linjiqin/archive/2012/04/04/2431975.html" style="text-decoration: none; color: #1a8bc8;">一、Oracle分析函数入门</a></h1><div id="cnblogs_post_body" style="margin-bottom: 20px; word-break: break-word; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"><strong>分析函数是什么？</strong><br />分析函数是Oracle专门用于<span style="line-height: 1.5; color: #ff0000;">解决复杂报表统计需求</span>的功能强大的函数，<span style="line-height: 1.5; color: #ff0000;">它可以在数据中进行分组然后计算基于组的某种统计值</span>，并且每一组的每一行都可以返回一个统计值。</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"><strong>分析函数和聚合函数的不同之处是什么？</strong><br />普通的聚合函数用group by分组，<span style="line-height: 1.5; color: #ff0000;">每个分组</span>返回一个统计值，而分析函数采用partition by分组，并且<span style="line-height: 1.5; color: #ff0000;">每组每行</span>都可以返回一个统计值。</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"><strong>分析函数的形式</strong><br />分析函数带有一个开窗函数over()，包含三个分析子句:分组(partition by), 排序(order by), 窗口(rows) ，他们的使用形式如下：over(partition by xxx order by yyy rows between zzz)。<br />注：窗口子句在这里我只说rows方式的窗口,range方式和滑动窗口也不提</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"><strong>分析函数例子(在scott用户下模拟)</strong></p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"><span style="line-height: 1.5; color: #ff0000;">示例目的：显示各部门员工的工资，并附带显示该部分的最高工资。<br /><br /></span></p><div class="cnblogs_code" style="margin: 5px 0px; color: #000000; font-size: 12px !important;"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">显示各部门员工的工资，并附带显示该部分的最高工资。</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span><span style="color: #0000ff; line-height: 1.5 !important;">SELECT</span> E.DEPTNO,<br />       E.EMPNO,<br />       E.ENAME,<br />       E.SAL,<br />       LAST_VALUE(E.SAL) <br />       <span style="color: #0000ff; line-height: 1.5 !important;">OVER</span>(PARTITION <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> E.DEPTNO <br />            <span style="color: #0000ff; line-height: 1.5 !important;">ORDER</span> <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> E.SAL ROWS <br />            <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">unbounded preceding and unbouned following针对当前所有记录的前一条、后一条记录，也就是表中的所有记录</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>            <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">unbounded：不受控制的，无限的</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>            <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">preceding：在...之前</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>            <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">following：在...之后</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>            <span style="color: #808080; line-height: 1.5 !important;">BETWEEN</span> UNBOUNDED PRECEDING <span style="color: #808080; line-height: 1.5 !important;">AND</span> UNBOUNDED FOLLOWING) MAX_SAL<br />  <span style="color: #0000ff; line-height: 1.5 !important;">FROM</span> EMP E;</pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div></div><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">运行结果：</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><img src="http://pic002.cnblogs.com/images/2012/270324/2012040415535157.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><span style="line-height: 1.5; color: #ff0000;">示例目的：按照deptno分组，然后计算每组值的总和</span></p><div class="cnblogs_code" style="margin: 5px 0px; color: #000000; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #0000ff; line-height: 1.5 !important;">SELECT</span> EMPNO,<br />       ENAME,<br />       DEPTNO,<br />       SAL,<br />       <span style="color: #ff00ff; line-height: 1.5 !important;">SUM</span>(SAL) <span style="color: #0000ff; line-height: 1.5 !important;">OVER</span>(PARTITION <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> DEPTNO <span style="color: #0000ff; line-height: 1.5 !important;">ORDER</span> <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> ENAME) max_sal<br />  <span style="color: #0000ff; line-height: 1.5 !important;">FROM</span> SCOTT.EMP;</pre></div><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">运行结果：</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><img src="http://pic002.cnblogs.com/images/2012/270324/2012040415590388.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><span style="line-height: 1.5; color: #ff0000;">示例目的：对各部门进行分组，并附带显示第一行至当前行的汇总</span></p><div class="cnblogs_code" style="margin: 5px 0px; color: #000000; font-size: 12px !important;"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #0000ff; line-height: 1.5 !important;">SELECT</span> EMPNO,<br />       ENAME,<br />       DEPTNO,<br />       SAL,<br />       <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">注意ROWS BETWEEN unbounded preceding AND current row  是指第一行至当前行的汇总</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>       <span style="color: #ff00ff; line-height: 1.5 !important;">SUM</span>(SAL) <span style="color: #0000ff; line-height: 1.5 !important;">OVER</span>(PARTITION <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> DEPTNO <br />                     <span style="color: #0000ff; line-height: 1.5 !important;">ORDER</span> <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> ENAME <br />                     ROWS <span style="color: #808080; line-height: 1.5 !important;">BETWEEN</span> UNBOUNDED PRECEDING <span style="color: #808080; line-height: 1.5 !important;">AND</span> <span style="color: #0000ff; line-height: 1.5 !important;">CURRENT</span> ROW) max_sal<br />  <span style="color: #0000ff; line-height: 1.5 !important;">FROM</span> SCOTT.EMP;</pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div></div><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">运行结果：</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><img src="http://pic002.cnblogs.com/images/2012/270324/2012040416042411.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">&nbsp;&nbsp;&nbsp;</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><span style="line-height: 1.5; color: #ff0000;">示例目标：当前行至最后一行的汇总</span></p><div class="cnblogs_code" style="margin: 5px 0px; color: #000000; font-size: 12px !important;"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #0000ff; line-height: 1.5 !important;">SELECT</span> EMPNO,<br />       ENAME,<br />       DEPTNO,<br />       SAL,<br />       <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">注意ROWS BETWEEN current row AND unbounded following 指当前行到最后一行的汇总</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>       <span style="color: #ff00ff; line-height: 1.5 !important;">SUM</span>(SAL) <span style="color: #0000ff; line-height: 1.5 !important;">OVER</span>(PARTITION <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> DEPTNO <br />                     <span style="color: #0000ff; line-height: 1.5 !important;">ORDER</span> <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> ENAME <br />                     ROWS <span style="color: #808080; line-height: 1.5 !important;">BETWEEN</span> <span style="color: #0000ff; line-height: 1.5 !important;">CURRENT</span> ROW <span style="color: #808080; line-height: 1.5 !important;">AND</span> UNBOUNDED FOLLOWING) max_sal<br />  <span style="color: #0000ff; line-height: 1.5 !important;">FROM</span> SCOTT.EMP;</pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div></div><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">运行结果：</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><img src="http://pic002.cnblogs.com/images/2012/270324/2012040416132921.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">&nbsp;&nbsp;&nbsp;</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><span style="line-height: 1.5; color: #ff0000;">&nbsp;示例目标：当前行的上一行(rownum-1)到当前行的汇总</span></p><div class="cnblogs_code" style="margin: 5px 0px; color: #000000; font-size: 12px !important;"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #0000ff; line-height: 1.5 !important;">SELECT</span> EMPNO,<br />       ENAME,<br />       DEPTNO,<br />       SAL,<br />       <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">注意ROWS BETWEEN 1 preceding AND current row 是指当前行的上一行(rownum-1)到当前行的汇总 </span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>       <span style="color: #ff00ff; line-height: 1.5 !important;">SUM</span>(SAL) <span style="color: #0000ff; line-height: 1.5 !important;">OVER</span>(PARTITION <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> DEPTNO <br />                     <span style="color: #0000ff; line-height: 1.5 !important;">ORDER</span> <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> ENAME ROWS <br />                     <span style="color: #808080; line-height: 1.5 !important;">BETWEEN</span> <span style="color: #800000; font-weight: bold; line-height: 1.5 !important;">1</span> PRECEDING <span style="color: #808080; line-height: 1.5 !important;">AND</span> <span style="color: #0000ff; line-height: 1.5 !important;">CURRENT</span> ROW) max_sal<br />  <span style="color: #0000ff; line-height: 1.5 !important;">FROM</span> SCOTT.EMP;</pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div></div><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">运行结果：</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><img src="http://pic002.cnblogs.com/images/2012/270324/2012040416170288.png" alt="" style="border: 0px;" /></p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">&nbsp;&nbsp;&nbsp;&nbsp;</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><span style="line-height: 1.5; color: #ff0000;">示例目标：&nbsp;&nbsp;&nbsp;当前行的上一行(rownum-1)到当前行的下辆行(rownum+2)的汇总&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><div class="cnblogs_code" style="margin: 5px 0px; color: #000000; font-size: 12px !important;"><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="color: #0000ff; line-height: 1.5 !important;">SELECT</span> EMPNO,<br />       ENAME,<br />       DEPTNO,<br />       SAL,<br />       <span style="color: #008080; line-height: 1.5 !important;">--</span><span style="color: #008080; line-height: 1.5 !important;">注意ROWS BETWEEN 1 preceding AND 1 following 是指当前行的上一行(rownum-1)到当前行的下辆行(rownum+2)的汇总</span><span style="color: #008080; line-height: 1.5 !important;"><br /></span>       <span style="color: #ff00ff; line-height: 1.5 !important;">SUM</span>(SAL) <span style="color: #0000ff; line-height: 1.5 !important;">OVER</span>(PARTITION <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> DEPTNO <br />                     <span style="color: #0000ff; line-height: 1.5 !important;">ORDER</span> <span style="color: #0000ff; line-height: 1.5 !important;">BY</span> ENAME <br />                     ROWS <span style="color: #808080; line-height: 1.5 !important;">BETWEEN</span> <span style="color: #800000; font-weight: bold; line-height: 1.5 !important;">1</span> PRECEDING <span style="color: #808080; line-height: 1.5 !important;">AND</span> <span style="color: #800000; font-weight: bold; line-height: 1.5 !important;">2</span> FOLLOWING) max_sal<br />  <span style="color: #0000ff; line-height: 1.5 !important;">FROM</span> SCOTT.EMP;</pre><div class="cnblogs_code_toolbar" style="margin-top: 5px;"><span class="cnblogs_code_copy" style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="http://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="border: none !important;" /></a></span></div></div><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;">运行结果：</p><p style="margin-top: 10px; margin-bottom: 10px; background-color: #ffffff;"><img src="http://pic002.cnblogs.com/images/2012/270324/2012040416191976.png" alt="" style="border: 0px;" /></p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"><span style="line-height: 1.5; color: #ff0000;"><br /></span></p></div><img src ="http://www.blogjava.net/yxhxj2006/aggbug/425032.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-05-13 00:46 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425032.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>常见分析函数详解</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425033.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Tue, 12 May 2015 16:46:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425033.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/425033.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425033.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/425033.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/425033.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 三、常见分析函数详解为了方便进行实践，特将演示表和数据罗列如下：一、创建表create table t(    bill_month varchar2(12) ,    area_code number,    net_type varchar(2),    local_fare number );&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;二、插入数据insert i...&nbsp;&nbsp;<a href='http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425033.html'>阅读全文</a><img src ="http://www.blogjava.net/yxhxj2006/aggbug/425033.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-05-13 00:46 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425033.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE 常用函数</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425031.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Tue, 12 May 2015 16:37:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425031.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/425031.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425031.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/425031.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/425031.html</trackback:ping><description><![CDATA[<div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">&nbsp; 这个系列我将整理一些日常我们经常使用到的ORACLE函数，鉴于篇幅太长，我大体会按下面分类来整理、汇总这些常用的ORACLE函数，如果有些常用函数没有被整理进来，也希望大家指点一二。</div><p style="line-height: 25px; margin-top: 10px; margin-bottom: 10px; color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; background-color: #ffffff;">&nbsp;1： 聚合函数</p><div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">2： 日期函数</div><div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">3： 字符串函数</div><div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">4： 格式化函数</div><div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">5： 类型转换函数</div><div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">6： 加密函数</div><div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">7： 控制流函数</div><div style="color: #333333; font-family: Georgia, 'Times New Roman', Times, sans-serif; line-height: 25px; background-color: #ffffff;">8： 数学函数</div><div style="background-color: #ffffff;"><font color="#333333" face="Georgia, Times New Roman, Times, sans-serif"><span style="line-height: 25px;">9： 系统信息函数</span></font><br /><font color="#333333" face="Georgia, Times New Roman, Times, sans-serif"><span style="line-height: 25px;">10：分析函数</span></font><br /><br /><div><span style="line-height: 25px;">------------------------------------------聚合函数---------------------------------------------</span></div><div><span style="line-height: 25px;">--1: &nbsp; AVG(DISTINCT|ALL)</span></div><div><span style="line-height: 25px;"><br /></span></div><div><span style="line-height: 25px;">ALL表示对所有的值求平均值,DISTINCT只对不同的值求平均值</span></div><div><span style="line-height: 25px;">SELECT AVG(SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT AVG(DISTINCT SAL) FROM SCOTT.EMP;</span></div><div></div><div><span style="line-height: 25px;">--2: &nbsp; MAX(DISTINCT|ALL)</span></div><div><span style="line-height: 25px;"><br /></span></div><div><span style="line-height: 25px;">求最大值,ALL表示对所有的值求最大值,DISTINCT表示对不同的值求最大值,相同的只取一次</span></div><div><span style="line-height: 25px;"><br /></span></div><div><span style="line-height: 25px;">(加不加查询结果一致，不知DISTINCT有什么用途，不同于AVG等聚合函数)</span></div><div><span style="line-height: 25px;">SELECT MAX(DISTINCT SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT MAX(SAL) FROM SCOTT.EMP</span></div><div></div><div><span style="line-height: 25px;">--3: &nbsp; MIN(DISTINCT|ALL)</span></div><div><span style="line-height: 25px;">求最小值,ALL表示对所有的值求最小值,DISTINCT表示对不同的值求最小值,相同的只取一次</span></div><div><span style="line-height: 25px;">SELECT MIN(SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT MIN(DISTINCT SAL) FROM SCOTT.EMP;<br /></span></div><div><span style="line-height: 25px;"><br />--4: &nbsp;STDDEV(distinct|all)</span></div><div><span style="line-height: 25px;">求标准差,ALL表示对所有的值求标准差,DISTINCT表示只对不同的值求标准差</span></div><div><span style="line-height: 25px;">SELECT STDDEV(SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT STDDEV(DISTINCT SAL) FROM SCOTT.EMP;</span></div><div><br /></div><div><span style="line-height: 25px;">--5: &nbsp; VARIANCE(DISTINCT|ALL)</span></div><div><span style="line-height: 25px;">求协方差 &nbsp;ALL表示对所有的值求协方差,DISTINCT表示只对不同的值求协方差</span></div><div><span style="line-height: 25px;">SELECT VARIANCE(SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT VARIANCE(DISTINCT SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;"><br />--6: &nbsp;SUM(DISTINCT|ALL)</span></div><div><span style="line-height: 25px;">求和 &nbsp;ALL表示对所有值求和，DISTINCT表示只对不同值求和(相同值只取一次)</span></div><div><span style="line-height: 25px;">SELECT SUM(SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT SUM(DISTINCT SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;"><br /><br />--7：COUNT(DISTINCT|ALL)</span></div><div><span style="line-height: 25px;">求记录、数据个数。 ALL对所有记录，数组做统计， DISTINCT只对不同值统计(相同值只取一次)</span></div><div><span style="line-height: 25px;">SELECT COUNT(SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT COUNT(DISTINCT SAL) FROM SCOTT.EMP; &nbsp;</span></div><div>&nbsp;</div><div><span style="line-height: 25px;">----8： MEDIAN</span></div><div><span style="line-height: 25px;">求中位数</span></div><div><span style="line-height: 25px;">SELECT MEDIAN(SAL) FROM SCOTT.EMP;</span></div><div><span style="line-height: 25px;">SELECT MEDIAN(DISTINCT SAL) FROM SCOTT.EMP; &nbsp;--错误：DISTINCT 选项在此函数中禁用。</span></div><div><span style="line-height: 25px;">----------------------------------------------------------------------------------------------</span></div></div><img src ="http://www.blogjava.net/yxhxj2006/aggbug/425031.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-05-13 00:37 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/05/13/425031.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何判断PHP空间是否支持curl, gzip等功能</title><link>http://www.blogjava.net/yxhxj2006/archive/2015/04/22/424583.html</link><dc:creator>奋斗成就男人</dc:creator><author>奋斗成就男人</author><pubDate>Tue, 21 Apr 2015 16:04:00 GMT</pubDate><guid>http://www.blogjava.net/yxhxj2006/archive/2015/04/22/424583.html</guid><wfw:comment>http://www.blogjava.net/yxhxj2006/comments/424583.html</wfw:comment><comments>http://www.blogjava.net/yxhxj2006/archive/2015/04/22/424583.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/yxhxj2006/comments/commentRss/424583.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/yxhxj2006/services/trackbacks/424583.html</trackback:ping><description><![CDATA[<div style="color: #333333; font-size: 16px; line-height: 28px; margin-top: 40px; font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; background-color: #ffffff;"><div exp-brief-step"="" style="text-align: justify; margin-top: 5px;"><div style="position: relative;"><div><p style="margin: 20px 0px; padding: 0px;">在使用PHP时，我们需要将自己写好的php文件上传到已申请的php空间。由于租用或申请的php空间是不允许用户进行配置的，那么对于php的一些功能是否开启，如curl, allow_url_fopen, gzip，就需要提前判断，而不是等写完代码后发现不能使用时，那样改动就大了。</p></div></div></div></div><div style="color: #333333; font-size: 16px; line-height: 28px; margin-top: 40px; font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; background-color: #ffffff;"><h2><a name="section-2" style="color: rgb(45, 100, 179); width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=image&amp;file=anchor.gif); background-repeat: no-repeat no-repeat;"></a>方法/步骤</h2><div style="text-align: justify; margin-top: 5px;"><ol style="margin: 0px; padding: 0px; list-style: none; clear: both;"><li list-item-1"="" style="margin: 20px 0px 0px 17px; padding: 0px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div style="width: 32px; height: 32px; position: absolute; left: -18px; top: 0px; color: #eeffee; text-align: center; line-height: 32px; background-image: url(http://img.baidu.com/img/iknow/exp/global/step_ol_bg.png); visibility: hidden; background-repeat: no-repeat no-repeat;"></div><div><p style="margin: 0px; padding: 0px;">其实判断功能是否开启，很简单，我们只需要写一个php文件上传之php空间服务器中。v.php的源代码如图。</p></div><div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a href="http://jingyan.baidu.com/album/574c5219cf92e86c8c9dc144.html?picindex=1" target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHP空间是否支持curl, gzip等功能" src="http://c.hiphotos.baidu.com/exp/w=500/sign=6db0ec9bdb33c895a67e987be1127397/4bed2e738bd4b31ce5950fb785d6277f9e2ff815.jpg" style="border: 0px; display: block;" /></a></div></div></li><li list-item-2"="" style="margin: 1px 0px 0px 17px; padding: 45px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div style="width: 32px; height: 32px; position: absolute; left: -18px; top: 43px; color: #eeffee; text-align: center; line-height: 32px; background-image: url(http://img.baidu.com/img/iknow/exp/global/step_ol_bg.png); visibility: hidden; background-repeat: no-repeat no-repeat;"></div><div><p style="margin: 0px; padding: 0px;">其含义很简单，就是传入一个函数的名字，服务器判断是否存在这个函数，如果存在则表示支持该函数对应的功能，输出&#8220;支持&#8221;，反之输出&#8220;不支持&#8221;。将文件上传至php空间中。</p></div><div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a href="http://jingyan.baidu.com/album/574c5219cf92e86c8c9dc144.html?picindex=2" target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHP空间是否支持curl, gzip等功能" src="http://e.hiphotos.baidu.com/exp/w=500/sign=cca6fd7ff9f2b211e42e854efa816511/e61190ef76c6a7ef1285332afffaaf51f3de661f.jpg" style="border: 0px; display: block;" /></a></div></div></li><li list-item-3"="" style="margin: 1px 0px 0px 17px; padding: 45px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div style="width: 32px; height: 32px; position: absolute; left: -18px; top: 43px; color: #eeffee; text-align: center; line-height: 32px; background-image: url(http://img.baidu.com/img/iknow/exp/global/step_ol_bg.png); visibility: hidden; background-repeat: no-repeat no-repeat;"></div><div><p style="margin: 0px; padding: 0px;">再通过访问空间，地址+v.php?f=+要测试的功能所包括的函数，比如curl功能可以是v.php?f=curl_init，allow_url_fopen功能可以用v.php?f=fopen来测试。</p></div><div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a href="http://jingyan.baidu.com/album/574c5219cf92e86c8c9dc144.html?picindex=3" target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHP空间是否支持curl, gzip等功能" src="http://e.hiphotos.baidu.com/exp/w=500/sign=0d78242f612762d0803ea4bf90ed0849/242dd42a2834349ba7aff589cbea15ce36d3be15.jpg" style="border: 0px; display: block;" /><span style="background-image: url(http://img.baidu.com/img/iknow/exp/article/show-step.png); width: 120px; height: 40px; position: absolute; top: 337px; left: 250px; margin-top: -20px; margin-left: -60px; line-height: 40px; font-family: 微软雅黑; color: #ffffff; text-indent: 22px; display: block; text-align: left; cursor: pointer; zoom: 1; background-repeat: no-repeat no-repeat;">步骤阅读</span></a></div><div clearfix"="" style="zoom: 1; position: relative; padding-top: 10px; padding-bottom: 10px;"><a href="http://jingyan.baidu.com/album/574c5219cf92e86c8c9dc144.html?picindex=4" target="_self" style="text-decoration: none; color: #2d64b3; position: relative; display: block; float: left;"><img alt="如何判断PHP空间是否支持curl, gzip等功能" src="http://b.hiphotos.baidu.com/exp/w=500/sign=b01c1c8bd2a20cf44690fedf46084b0c/3b292df5e0fe992555aff25c36a85edf8db1711f.jpg" style="border: 0px; display: block;" /></a></div></div></li><li list-item-3"="" style="margin: 1px 0px 0px 17px; padding: 45px 0px 0px 35px; display: block; position: relative; min-height: 31px; border-left-width: 2px; border-left-style: dotted; border-left-color: #e4e4e4;"><div></div></li></ol></div></div><img src ="http://www.blogjava.net/yxhxj2006/aggbug/424583.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/yxhxj2006/" target="_blank">奋斗成就男人</a> 2015-04-22 00:04 <a href="http://www.blogjava.net/yxhxj2006/archive/2015/04/22/424583.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>