??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美自拍一区,国产精品视频久久久久,青青草国产一区二区三区http://www.aygfsteel.com/cccp21/zh-cnSat, 14 Jun 2025 05:57:56 GMTSat, 14 Jun 2025 05:57:56 GMT60JDBC查询动态封?/title><link>http://www.aygfsteel.com/cccp21/archive/2009/01/26/252588.html</link><dc:creator>cccp21</dc:creator><author>cccp21</author><pubDate>Mon, 26 Jan 2009 10:38:00 GMT</pubDate><guid>http://www.aygfsteel.com/cccp21/archive/2009/01/26/252588.html</guid><wfw:comment>http://www.aygfsteel.com/cccp21/comments/252588.html</wfw:comment><comments>http://www.aygfsteel.com/cccp21/archive/2009/01/26/252588.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.aygfsteel.com/cccp21/comments/commentRss/252588.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/cccp21/services/trackbacks/252588.html</trackback:ping><description><![CDATA[JDBC针对条g个数不定的查询,一般的做法是直接拼装查询字W串Q但是这样做无法抵M注入dQ还是要装才安全,但是装Ҏ件个数、类型不定,是很有困隄Q最q终于找C解决办法Q?br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> queryDAOImpl </span><span style="color: #0000ff;">implements</span><span style="color: #000000;"> queryDAO {<br />     </span><span style="color: #008000;">/**</span><span style="color: #008000;"><br />      * 动态拼装查?br />      * </span><span style="color: #808080;">@param</span><span style="color: #008000;"> mq 装查询条g的类<br />      * </span><span style="color: #808080;">@return</span><span style="color: #008000;"><br />      * </span><span style="color: #808080;">@throws</span><span style="color: #008000;"> java.sql.SQLException<br />      </span><span style="color: #008000;">*/</span><span style="color: #000000;"><br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> List</span><span style="color: #000000;"><</span><span style="color: #000000;">Map</span><span style="color: #000000;">></span><span style="color: #000000;"> queryAll(MnewsQ mq) </span><span style="color: #0000ff;">throws</span><span style="color: #000000;"> SQLException {</span><span style="color: #000000;"><br />         List</span><span style="color: #000000;"><</span><span style="color: #000000;">Map</span><span style="color: #000000;">></span><span style="color: #000000;"> v </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Vector</span><span style="color: #000000;"><</span><span style="color: #000000;">Map</span><span style="color: #000000;">></span><span style="color: #000000;">();<br />         Connection con </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">null</span><span style="color: #000000;">;<br />         PreparedStatement pstmt </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">null</span><span style="color: #000000;">;<br />         ResultSet rs </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">null</span><span style="color: #000000;">;<br />         Vector t </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Vector();   </span><span style="color: #008000;">//</span><span style="color: #008000;">储存查询条g</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        Vector</span><span style="color: #000000;"><</span><span style="color: #000000;">String</span><span style="color: #000000;">></span><span style="color: #000000;"> t2 </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Vector</span><span style="color: #000000;"><</span><span style="color: #000000;">String</span><span style="color: #000000;">></span><span style="color: #000000;">();   </span><span style="color: #008000;">//</span><span style="color: #008000;">储存查询条gcd</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        String sql </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">SELECT * FROM mnews WHERE mnews.sc=0</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;">如果提交了查询条件gj (int?</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        </span><span style="color: #0000ff;">if</span><span style="color: #000000;"> (mq.getGj() </span><span style="color: #000000;">></span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">) {<br />             sql </span><span style="color: #000000;">=</span><span style="color: #000000;"> sql </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;"> AND gj=?</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br />             t.add(mq.getGj());<br />             t2.add(</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br />         }<br />         </span><span style="color: #008000;">//</span><span style="color: #008000;">如果提交了查询条件gjz4 (String?</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">        </span><span style="color: #0000ff;">if</span><span style="color: #000000;"> (mq.getGjz4() </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">null</span><span style="color: #000000;"> </span><span style="color: #000000;">&&</span><span style="color: #000000;"> mq.getGjz4().length() </span><span style="color: #000000;">></span><span style="color: #000000;"> </span><span style="color: #000000;">0</span><span style="color: #000000;">) {<br />             sql </span><span style="color: #000000;">=</span><span style="color: #000000;"> sql </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;"> AND gjz4=?</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br />             t.add(mq.getGjz4());<br />             t2.add(</span><span style="color: #000000;">"</span><span style="color: #000000;">String</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br />         }<br />         </span><span style="color: #0000ff;">try</span><span style="color: #000000;"> {<br />             con </span><span style="color: #000000;">=</span><span style="color: #000000;"> ConnectionMannagerJNDI.getCon();    </span><span style="color: #008000;">//</span><span style="color: #008000;">取得数据库连?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">            pstmt </span><span style="color: #000000;">=</span><span style="color: #000000;"> con.prepareStatement(sql);<br />             </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> paramNum </span><span style="color: #000000;">=</span><span style="color: #000000;"> t.size();    </span><span style="color: #008000;">//</span><span style="color: #008000;">查询条g数量</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">            </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">; i</span><span style="color: #000000;"><</span><span style="color: #000000;">paramNum; i</span><span style="color: #000000;">++</span><span style="color: #000000;">) {<br />                 </span><span style="color: #0000ff;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">"</span><span style="color: #000000;">int</span><span style="color: #000000;">"</span><span style="color: #000000;">.equals(t2.get(i).toString())) {<br />                     pstmt.setInt(i </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">2</span><span style="color: #000000;">, Integer.parseInt(t.get(i).toString()));<br />                 } </span><span style="color: #0000ff;">else</span><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">"</span><span style="color: #000000;">String</span><span style="color: #000000;">"</span><span style="color: #000000;">.equals(t2.get(i).toString())) {<br />                     pstmt.setString(i </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">1</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">2</span><span style="color: #000000;">, t.get(i).toString());<br />                 }</span><span style="color: #008000;">//</span><span style="color: #008000;">Date、float{类型依此类?/span><span style="color: #008000;"><br /> </span><span style="color: #000000;">            }<br />             rs </span><span style="color: #000000;">=</span><span style="color: #000000;"> pstmt.executeQuery();<br />             </span><span style="color: #008000;">//</span><span style="color: #008000;">以字D名为键Q以字段gؓ|查询结果存入MapQ再装进Vector</span><span style="color: #008000;"><br /> </span><span style="color: #000000;">            ResultSetMetaData rsmd </span><span style="color: #000000;">=</span><span style="color: #000000;"> rs.getMetaData();<br />             </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> columnNum </span><span style="color: #000000;">=</span><span style="color: #000000;"> rsmd.getColumnCount();<br />             </span><span style="color: #0000ff;">while</span><span style="color: #000000;"> (rs.next()) {<br />                 Map map </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> HashMap();<br />                 </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">; i</span><span style="color: #000000;"><=</span><span style="color: #000000;">columnNum; i</span><span style="color: #000000;">++</span><span style="color: #000000;">) {<br />                     map.put(rsmd.getColumnName(i),rs.getObject(i));<br />                 }<br />                 v.add(map);<br />             }<br />         } </span><span style="color: #0000ff;">finally</span><span style="color: #000000;"> {<br />             ConnectionMannagerJNDI.releaseConnection(rs, pstmt, </span><span style="color: #0000ff;">null</span><span style="color: #000000;">, con);<br />         }<br />         </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> v;<br />     }<br /> }</span></div> <br /> <br /> <img src ="http://www.aygfsteel.com/cccp21/aggbug/252588.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/cccp21/" target="_blank">cccp21</a> 2009-01-26 18:38 <a href="http://www.aygfsteel.com/cccp21/archive/2009/01/26/252588.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>破解NetbeansGUI~辑器源代码不可~辑的“秘密?/title><link>http://www.aygfsteel.com/cccp21/archive/2008/07/31/219146.html</link><dc:creator>cccp21</dc:creator><author>cccp21</author><pubDate>Thu, 31 Jul 2008 11:43:00 GMT</pubDate><guid>http://www.aygfsteel.com/cccp21/archive/2008/07/31/219146.html</guid><wfw:comment>http://www.aygfsteel.com/cccp21/comments/219146.html</wfw:comment><comments>http://www.aygfsteel.com/cccp21/archive/2008/07/31/219146.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/cccp21/comments/commentRss/219146.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/cccp21/services/trackbacks/219146.html</trackback:ping><description><![CDATA[在做一个GUIӞH然发现在插入一个按钮方法时L插到了已有的一个方法代码里面,后来仔细一看,原来是代码中的一行显CZؓ不可~辑的灰Ԍ可这代码是我自己写的而不是系l生成的Q怎么不可~辑呢,q是怎么回事呢?后来我干脆用C本打开q个文gQ结果在不可~辑行发C如下代码Q?br /> //GEN-LAST:event_jButton1ActionPerformed<br /> q个双斜杠及后面的字W在Netbeans~辑器中不显C,它就是决定不可编辑区域的标记Q?br /> <br /> 自定义函数首行不可~辑Q?br /> 不可~辑单行Q首行:<br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<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;">GEN-FIRST:event_jButton1ActionPerformed</span></div> <br /> 注:“event_”后面是函数名<br /> 行Q?br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<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;">GEN-LAST:event_jButton1ActionPerformed</span></div> <br /> 不可~辑区域Q?br /> 开始:<br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<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;"> <editor-fold defaultstate="collapsed" desc="Generated Code"></span><span style="color: #008000;">//</span><span style="color: #008000;">GEN-BEGIN:initComponents</span></div> <br /> l束Q?br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<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;"> </editor-fold></span><span style="color: #008000;">//</span><span style="color: #008000;">GEN-END:initComponents</span></div> <br /> <img src ="http://www.aygfsteel.com/cccp21/aggbug/219146.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/cccp21/" target="_blank">cccp21</a> 2008-07-31 19:43 <a href="http://www.aygfsteel.com/cccp21/archive/2008/07/31/219146.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>HibernateE序?4位{Ud32位机上运行遇到的问题http://www.aygfsteel.com/cccp21/archive/2008/04/14/192889.htmlcccp21cccp21Mon, 14 Apr 2008 10:50:00 GMThttp://www.aygfsteel.com/cccp21/archive/2008/04/14/192889.htmlhttp://www.aygfsteel.com/cccp21/comments/192889.htmlhttp://www.aygfsteel.com/cccp21/archive/2008/04/14/192889.html#Feedback0http://www.aygfsteel.com/cccp21/comments/commentRss/192889.htmlhttp://www.aygfsteel.com/cccp21/services/trackbacks/192889.html 在开发机上运行时Q报错:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
错在q一行:
int count = ((Integer)o[0]).intValue();
但是在服务器上运行时正常?br /> 把这一行改?br /> int count = ((Long)o[0]).intValue();
后,在开发机上运行时正常Q但是在服务器上q行时报错,错误内容是反过来的Q整型不能{换成常整型?br />
出错的行所在的函数Q?br />
    /** *//**
     * L行榜
     * 
@return ListcdQ原本是ArrayList型,元素是包含项目序号和名称的ArrayList?br />      */
    
public List getZong() {
        ArrayList alist 
= new ArrayList();
        org.hibernate.Session s 
= HibernateSessionFactory.currentSession();
        String hql 
= "select count(x.xmh),x,m from Xzb x,Xmb m where x.xmh=m.xh and m.sc=0 group by x.xmh order by col_0_0_ desc";
        org.hibernate.Query query 
= s.createQuery(hql);
        query.setMaxResults(
7);
        List list 
= query.list();
        Object[] o 
= null;
        
for (Iterator its = list.iterator(); its.hasNext(); ) {
            o 
= (Object[])its.next();
            Xzb xzb 
= (Xzb)o[1];
            ArrayList tmplist 
= new ArrayList();
            Xmb xmb 
= xzb.getXmh();
            tmplist.add(xmb.getXh());
            tmplist.add(xmb.getXmm());

            
int count = ((Integer)o[0]).intValue();    //int count = ((Long)o[0]).intValue();

            tmplist.add(count);
            alist.add(tmplist);
        }
        HibernateSessionFactory.closeSession();
        
return alist;
    }



后来注意到现在用的机器的cpu是DualCore Pentium E2140Q是64位的Q而服务器是Xeon Prestonia 2.8GHzQ是32位。很可能?4位与32位的问题Q可?4位机上的整型C32位机上就被认为是长整型。经询问后得知,把出错行改ؓQ?br /> ((Number)o[0]).intValue();
用Integer和Long的超cNumberQ问题解冟?br /> 原来以前听说的类定义量宽泛一些是q个好处啊?br />

cccp21 2008-04-14 18:50 发表评论
]]>
取得当前路径http://www.aygfsteel.com/cccp21/articles/170720.htmlcccp21cccp21Wed, 26 Dec 2007 13:09:00 GMThttp://www.aygfsteel.com/cccp21/articles/170720.htmlhttp://www.aygfsteel.com/cccp21/comments/170720.htmlhttp://www.aygfsteel.com/cccp21/articles/170720.html#Feedback0http://www.aygfsteel.com/cccp21/comments/commentRss/170720.htmlhttp://www.aygfsteel.com/cccp21/services/trackbacks/170720.html ?br /> ?br />
String path1 = this.getClass().getClassLoader().getResource(".").getPath();     //取得根目录(classesQ\?F:/zzd/java/test/p_test/build/classes/

?
getResource("XXX")     //取得根目录下的目录、文件的路径QXX为目录、文件名/F:/zzd/java/test/p_test/build/classes/Notepad.classQ,更深的目录、文件不?/span>
?
getResource("/")     //不行

String path = path1.substring(path1.indexOf('/'+ 1, path1.indexOf("/WEB-INF")) + "/tp/" + tpb.getWjm();    //必须path1.indexOf('/') + 1而不?Q因为path1可能以file:/开?/span>


?br />
getClass().getName();     //包括包的cd
?br />
getClass().getPackage().getName();     //包名


二、Servlet
?br /> ?br />
String filePath = this.getServletContext().getRealPath("/");    //只能得到web目录F:\zzd\java\softdown\build\web\Q其他无?/span>
?br />
getRealPath(".")           //无效
?br />
getRealPath("XXX")          //无效

?br /> ?br />
String path = this.getClass().getClassLoader().getResource("/").getPath();    //得到cȝ?F:/zzd/java/softdown/build/web/WEB-INF/classes/
?br />
getResource("XXX")        //(?#8220;一”)
?br />
getResource(".")        //取得/D:/Tomcat/common/classes/

String s = request.getServletPath();    //得到本Servlet的web相对路径Q?pathTest
String s = request.getRequestURI();    //得到本Servlet的webl对路径Q?strutsTest/pathTest


三、Action
?br />
String filePath = this.getServlet().getServletContext().getRealPath("/");    //得到web目录F:\zzd\java\softdown\build\web\
?br /> ?br />
String path = this.getClass().getClassLoader().getResource("/").getPath();    //取得根目录(classesQ\?F:/zzd/java/test/strutsTest2/build/web/WEB- INF/classes/
?br />
getResource("XXX")         //?#8220;一”QXXX可ؓclasses目录下的文gQ更q录下的文仉写出完整的相Ҏ目录QclassesQ的路径Q如Qcom.myapp.struts

String path = p1.substring(p1.indexOf('/'+ 1, p1.lastIndexOf('/')) + "相对路径";    //得到的\径以'/'开_所以需p1.indexOf('/') + 1处理Q用p1.lastIndexOf('/')L最后的"/XXX"


三、JSP
只能得到web目录F:\zzd\java\test\strutsTest\build\web\Q其他无?br /> ?br /> ?br />
String path = pageContext.getServletContext().getRealPath("");               //得到web目录F:\zzd\java\test\strutsTest\build\webQ没有最后的“\”Q?/span>
?br />
String path = pageContext.getServletContext().getRealPath("/");          //得到web目录F:\zzd\java\test\strutsTest\build\web
?br /> ?br />
String strPathFile2 = application.getRealPath("");        //得到web目录F:\zzd\java\test\strutsTest\build\webQ没有最后的“\”Q?/span>
?br />
String strPathFile2 = application.getRealPath("/");       //得到web目录F:\zzd\java\test\strutsTest\build\web\

=======================
1、服务器端的地址

服务器端的相对地址指的是相对于你的web应用的地址Q这个地址是在服务器端解析的,也就是说q时候在jsp和servlet中的相对地址应该是相对于你的web应用Q即相对于http: //192.168.0.1/webapp/的?br />
其用到的地方有:

forwarderQ?br /> ervlet中的request.getRequestDispatcher(address);
q个address是在服务器端解析的,所以,你要 forwarder到a.jsp应该q么写:request.getRequestDispatcher(“/user/a.jsp”)q个/相对于当前的web应用webappQ其l对地址是Qhttp://192.168.0.1/webapp/user/a.jsp?br />
sendRedirectQ?br /> 在jsp?lt;%response.sendRedirect("/rtccp/user/a.jsp");%>

struts的配|文件中Qforward路径应当?/"开?br /> =====

对classE序文g来说Qclasses目录是根目录


cccp21 2007-12-26 21:09 发表评论
]]>
输出汉字的Unicode?/title><link>http://www.aygfsteel.com/cccp21/archive/2007/12/05/165440.html</link><dc:creator>cccp21</dc:creator><author>cccp21</author><pubDate>Wed, 05 Dec 2007 03:50:00 GMT</pubDate><guid>http://www.aygfsteel.com/cccp21/archive/2007/12/05/165440.html</guid><wfw:comment>http://www.aygfsteel.com/cccp21/comments/165440.html</wfw:comment><comments>http://www.aygfsteel.com/cccp21/archive/2007/12/05/165440.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/cccp21/comments/commentRss/165440.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/cccp21/services/trackbacks/165440.html</trackback:ping><description><![CDATA[有时候需要输出汉字的Unicode|而且不是在property文g中,q样没有现成的ҎQ其实,<br /> System.out.println((int)'?);<br /> 输出的数字就?0q制的unicode?转ؓ16q制卛_?br /> <br /> 自己写的转换函数Q?br /> <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />      * q回16q制字符?br />      * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> k 待{换的10q制整数<br />      * </span><span style="color: rgb(128, 128, 128);">@return</span><span style="color: rgb(0, 128, 0);"> 16q制字符?br />      * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> headOrNo 是否?0x"开_是则加,否则不加<br />      </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> String toHex(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> k, </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> headOrNo) {<br />         StringBuffer sb </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> StringBuffer(</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">);<br />         String flag </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">0x</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />         </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (k </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">) {<br />             flag </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">-0x</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />             k </span><span style="color: rgb(0, 0, 0);">*=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">;<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> t;<br />        <br />         </span><span style="color: rgb(0, 0, 255);">do</span><span style="color: rgb(0, 0, 0);"> {<br />             t </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> k </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">16</span><span style="color: rgb(0, 0, 0);">;<br />             </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (t </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">9</span><span style="color: rgb(0, 0, 0);">) {<br />                 </span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"> c </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">A</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">;<br />                 </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">t</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">10</span><span style="color: rgb(0, 0, 0);">; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">,c</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">);<br />                 sb.insert(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,c);<br />             } </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> {<br />                 sb.insert(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,t);<br />             }<br />             k </span><span style="color: rgb(0, 0, 0);">/=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">16</span><span style="color: rgb(0, 0, 0);">;<br />         } </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">(k </span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">);<br />         </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (headOrNo) {<br />             sb.insert(</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,flag);<br />         } </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> {<br />             </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> sb.toString();<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> sb.toString();<br />     }</span></div> <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />      * q回字符的unicode码字W串<br />      * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> c 待{换的字符<br />      * </span><span style="color: rgb(128, 128, 128);">@return</span><span style="color: rgb(0, 128, 0);"> 字符的unicode码:/uXXXX<br />      </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> String char2Unicode(</span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"> c) {<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/u</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> toHex(c, </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">);<br />     }</span></div>     <br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />      * q回字符串的unicode码字W串<br />      * </span><span style="color: rgb(128, 128, 128);">@param</span><span style="color: rgb(0, 128, 0);"> s 待{换的字符?br />      * </span><span style="color: rgb(128, 128, 128);">@return</span><span style="color: rgb(0, 128, 0);"> 字符串的unicode码:/uXXXX/uXXXX<img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /><br />      </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> String getUnicode2(String s) {<br />         StringBuffer sb </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> StringBuffer(</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">);<br />         </span><span style="color: rgb(0, 0, 255);">char</span><span style="color: rgb(0, 0, 0);"> c[] </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> s.toCharArray();<br />         </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">c.length; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) {<br />             sb.append(char2Unicode(c[i]));<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> sb.toString();<br />     }</span></div> <br /> <br /> Unicode联盟的网站有一个到码表的链接,列出?6位码倹{英语,法语Qd语,葡萄牙语和西班牙语字W都在Basic Latin区,日语字符在Hiragana区,俄语字符在Cyrillic区,汉语字符在CJK Unified Ideographs 区?br /> <img src ="http://www.aygfsteel.com/cccp21/aggbug/165440.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/cccp21/" target="_blank">cccp21</a> 2007-12-05 11:50 <a href="http://www.aygfsteel.com/cccp21/archive/2007/12/05/165440.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Apache jakarta包的一些依赖性问?/title><link>http://www.aygfsteel.com/cccp21/archive/2007/11/11/159757.html</link><dc:creator>cccp21</dc:creator><author>cccp21</author><pubDate>Sun, 11 Nov 2007 08:42:00 GMT</pubDate><guid>http://www.aygfsteel.com/cccp21/archive/2007/11/11/159757.html</guid><wfw:comment>http://www.aygfsteel.com/cccp21/comments/159757.html</wfw:comment><comments>http://www.aygfsteel.com/cccp21/archive/2007/11/11/159757.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/cccp21/comments/commentRss/159757.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/cccp21/services/trackbacks/159757.html</trackback:ping><description><![CDATA[commons-net依赖jakarta-oro<br /> commons-fileupload依赖commons-io <img src ="http://www.aygfsteel.com/cccp21/aggbug/159757.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/cccp21/" target="_blank">cccp21</a> 2007-11-11 16:42 <a href="http://www.aygfsteel.com/cccp21/archive/2007/11/11/159757.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>装与工厂方法的意义http://www.aygfsteel.com/cccp21/archive/2007/08/13/136296.htmlcccp21cccp21Mon, 13 Aug 2007 02:03:00 GMThttp://www.aygfsteel.com/cccp21/archive/2007/08/13/136296.htmlhttp://www.aygfsteel.com/cccp21/comments/136296.htmlhttp://www.aygfsteel.com/cccp21/archive/2007/08/13/136296.html#Feedback0http://www.aygfsteel.com/cccp21/comments/commentRss/136296.htmlhttp://www.aygfsteel.com/cccp21/services/trackbacks/136296.html 可以对对象中的某一个属性进行操作,讉Kq些数据对外只提供了q么一个接口?br />
如果不提供这些方法,属性若?private 变得无法访问了?br />
如果属性变?publicQ就好比Q到银行d钱,不是通过柜面q行操作的,而是直接跑到银行的金库里面自己去拉K了,q样很不安全,q个例子中,可以把银行金库中的钱看作是某一对象的属性,而柜面的工作人员、出Ux台就可以看作?set / get Ҏ了,也就是让对外服务提供某些接口Q具体里面的操作隐藏v来了?br />


二、工厂方?br /> 指的是根据不同的情况产生不同的对象,比如Q?br />
public static Dao getDao(String dbmsName) throws UnsupportDatabaseException {
if( dbmsName.equalsIgnoreCase("SQL Server") ) {
return new SqlServerDao();
else if( dbmsName.equalsIgnoreCase("Oracle") ) {
return new OracleDao();
else if( dbmsName.equalsIgnoreCase("MySQL") ) {
return new MySQLDao();
else {
throw new UnsupportDatabaseException(dbmsName);
}
}


其中 Dao ?SqlServerDao、OracleDao、MySQLDao 的接口?br />
上面q段代码是一个典型的工厂ҎQ通过传入的数据库名称来确定,q获得不同的数据库处理实现。若使用的数据库q没有实玎ͼ则进行异常处理?br />

cccp21 2007-08-13 10:03 发表评论
]]>
jdom1.0常用用法http://www.aygfsteel.com/cccp21/archive/2007/08/10/135681.htmlcccp21cccp21Fri, 10 Aug 2007 00:33:00 GMThttp://www.aygfsteel.com/cccp21/archive/2007/08/10/135681.htmlhttp://www.aygfsteel.com/cccp21/comments/135681.htmlhttp://www.aygfsteel.com/cccp21/archive/2007/08/10/135681.html#Feedback0http://www.aygfsteel.com/cccp21/comments/commentRss/135681.htmlhttp://www.aygfsteel.com/cccp21/services/trackbacks/135681.html
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.input.SAXBuilder;


?br />
String path = xml文路径;

?br />
SAXBuilder builder = new SAXBuilder();
Document doc 
= builder.build(path);

③得到根节点Q?br />
Element e = doc.getRootElement();


二、操?br /> Q?Q读?br /> 1?br /> ①得到指定子节点Q?br />
e.getChild("节点?/span>");

②得到指定子节点内容Q?br />
e.getChild(节点?.getValue();
?br />
e.getChildText(节点?;

③得到指定属性|
e.getAttributeValue(属性名);

④遍历子节点Q?br />
java.util.List l = e.getChildren();    //得到所有子节点?/span>

?br />
java.util.List l = e.getChildren();    //得到指定名字的子节点?/span>

遍历Q?br />
        for (int i=0; i<l.size(); i++) {
            Element e2 
= (Element)l.get(i);
            ArrayList tl 
= new ArrayList();
            tl.add(e2.getChildText(
"url"));
            tl.add(e2.getChildText(
"sm"));
            list.add(tl);
        }


Q?Q编?br />
e.getChild(节点?.setText(内容);


Q?Q添?br /> ①新?br />
Element newE = new Element(节点?;
Element sm 
= new Element(节点?;

②ؓ节点d内容
sm.addContent(内容);

③将一个节点加入另一个节?br />
newE.addContent(sm);
root.addContent(newE);

④ؓ节点d属性及?br />
newE.setAttribute("id",id);


Q?Q删?br /> 删除当前节点Q?br />
e.getParentElement().removeContent(e);


三、写文g
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;

XMLOutputter outputter 
= new XMLOutputter(Format.getPrettyFormat().setEncoding("gb2312"));    //讑ֈ~码为gb2312以写入中?/span>
java.io.OutputStream outStream = new java.io.FileOutputStream(path);
outputter.output(doc, outStream);
outStream.flush();
outStream.close();



cccp21 2007-08-10 08:33 发表评论
]]>
web工程中用proxoolq接?/title><link>http://www.aygfsteel.com/cccp21/archive/2007/08/10/135680.html</link><dc:creator>cccp21</dc:creator><author>cccp21</author><pubDate>Fri, 10 Aug 2007 00:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/cccp21/archive/2007/08/10/135680.html</guid><wfw:comment>http://www.aygfsteel.com/cccp21/comments/135680.html</wfw:comment><comments>http://www.aygfsteel.com/cccp21/archive/2007/08/10/135680.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/cccp21/comments/commentRss/135680.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/cccp21/services/trackbacks/135680.html</trackback:ping><description><![CDATA[<p><strong>1</strong>、从http://proxool.sourceforge.net/下蝲proxoolQ释放proxool.jar到WEB-INF/<span id="wmqeeuq" class="style1">lib</span><br /> <br /> <strong>2</strong>?1)HibernateQ?/p> <p>  ①、在<span id="wmqeeuq" class="style1">hibernate.cfg.xml</span>中增加:<br /> </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.proxool.pool_alias"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">dbpool</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="hibernate.proxool.xml"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">proxool.xml</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="connection.provider_class"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">org.hibernate.connection.ProxoolConnectionProvider</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">property</span><span style="color: rgb(0, 0, 255);">></span></div> <br /> <br /> ②、在与hibernate.cfg.xml同目录Qsrc根目录下Q增?span class="style1">proxool.xml</span>文gQ?br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);"><?</span><span style="color: rgb(255, 0, 255);">xml version="1.0" encoding="utf-8"</span><span style="color: rgb(0, 0, 255);">?></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);"> the proxool configuration can be embedded within your own application's.<br />     Anything outside the "proxool" tag is ignored. </span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">something-else-entirely</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">proxool</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">alias</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">dbpool</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">alias</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);">proxool只能理p׃生的q接</span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">driver-url</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />             jdbc:mysql://localhost:3306/msms<br />         </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">driver-url</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">driver-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">com.mysql.jdbc.Driver</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">driver-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">driver-properties</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />             </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="user"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="sqh"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />             </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">property </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="password"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="sqh"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">driver-properties</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);"> proxool自动侦察各个q接状态的旉间隔(毫秒),侦察到空闲的q接马上回?时的销?/span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">house-keeping-sleep-time</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">90000</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">house-keeping-sleep-time</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);"> 最保持的I闲q接?/span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">prototype-count</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">prototype-count</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);"> 允许最大连接数,过了这个连接,再有hӞ排在队列中{候,最大的{待h数由maximum-new-connections军_</span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">maximum-connection-count</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">maximum-connection-count</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);"> 最连接数</span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">minimum-connection-count</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">10</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">minimum-connection-count</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">house-keeping-test-sql</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">select CURRENT_DATE</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">house-keeping-test-sql</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">proxool</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">something-else-entirely</span><span style="color: rgb(0, 0, 255);">></span></div> <br /> <p> </p> <p>  Q?Q①、在WEB-INF目录下增?span class="style1">proxool.xml</span>文g?/p> <p>   ②、配|web.xml <br /> 在web.xml中增加: Q这个相当于E序中用JAXPConfigurator.configure("proxool.xml", false)。在Hibernate中不需要这一步) <br /> <!-- 配置初始化servlet,在web容器加蝲的时候自动加载配|文Ӟ如果不是webE序Q这个部分就需要通过开发接口来初始化了 --> <br /> </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">proxoolInitialServlet</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">org.logicalcobwebs.proxool.configuration.ServletConfigurator</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">xmlFile</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">WEB-INF/proxool.xml</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">load-on-startup</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">load-on-startup</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span></div> <br /> <p> </p> <p>3?lt;!--配置<span id="wmqeeuq" class="style1">监控servlet</span>,其实如果不想监控的话Q可以不?-> <br /> </p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">dbpoolAdmin</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">org.logicalcobwebs.proxool.admin.servlet.AdminServlet</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">dbpoolAdmin</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/dbpool</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span></div> <br /> <p> </p> <p>4、重起tomcat </p> <p>5、在E序中调?</p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">Connection con </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> DriverManager.getConnection(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">proxool.别名</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);</span></div> <img src ="http://www.aygfsteel.com/cccp21/aggbug/135680.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/cccp21/" target="_blank">cccp21</a> 2007-08-10 08:32 <a href="http://www.aygfsteel.com/cccp21/archive/2007/08/10/135680.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ī</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">캵</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ӱ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Դ</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ߴ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ׯ</a>| <a href="http://" target="_blank">¤</a>| <a href="http://" target="_blank">ൺ</a>| <a href="http://" target="_blank">ײ</a>| <a href="http://" target="_blank">ͼ</a>| <a href="http://" target="_blank">ȳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">ͳ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>