proxoolÔÚjspÖеÄÓ¦ÓÃ
ÏÈÌù¸ö½éÉÜ
http://i.cn.yahoo.com/suzie0228/blog/p_41/
proxoolÊÇÒ»¸ö¿ªÔ´µÄÁ¬½Ó³Ø£¬ÐÔÄÜÓÅÒ죬×îºÃµÄÊÇ£º¼´Ê±¼à¿ØÁ¬½Ó³Ø״̬
ÏÂÃæ¼òµ¥ËµËµËüµÄʹÓ÷½·¨£º1¡¢Ê×ÏÈÏÂÔØproxool µØÖ·£ºhttp://proxool.sourceforge.net
2¡¢½âѹËõproxool-0.9.0RC3.zip£¬¿½±´libϵÄËùÓÐjar¿âÎļþµ½ÄãµÄ¹¤³ÌϵÄWEB-INF/libÏ£¬Í¬Ê±¼ÇµÃÒ²°ÑMysqlµÄjdbcÇý¶¯µ½web-info/lib
3¡¢ÔÚWEB-INFÏ£¨±ðÅÜ´íµØ·½£©½¨Á¢Îļþ£ºproxool.xml
proxool.xmlÕâ¸öÎļþÊÇÓÃÀ´ÉèÖñðÃûµÄ¡£
ÆäÖÐ<proxool>±êÇ©¾ÍÊDZðÃûµÄÉèÖöΡ£
aliasÊDZðÃû£»
driver-urlÊÇÇý¶¯µÄurl£¬¾ÍÊÇÁ¬½ÓµÄurl£»
driver-classÊÇÇý¶¯µÄÀ࣬¾ÍÊÇÊý¾Ý¿âÇý¶¯£»
driver-propertiesÊÇÇý¶¯µÄÊôÐÔ£¬¿ÉÒÔÉèÖõǽÊý¾Ý¿âµÄÓû§ÃûºÍÃÜÂë¡£maximum-connection-countÊÇ×î´óÁ¬½ÓÊý¡£
´úÂë
ÎļþÄÚÈÝÈçÏ£º
<?xml version="1.0" encoding="UTF-8"?>
<proxool>
<alias>DBPool</alias> <!--ÕâÀïÊÇÁ¬½Ó³ØµÄ±ðÃû-->
<driver-url>jdbc:mysql://localhost:3306/databaseName</driver-url>
<driver-class>org.gjt.mm.mysql.Driver</driver-class>
<driver-properties>
<property name="user" value="root"/>
<property name="password" value="12345"/>
</driver-properties>
<maximum-connection-count>500</maximum-connection-count>
<house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql>
</proxool>
4¡¢ÔÚWEB-INF/web.xmlÖÐ<web-app>½ÚµãÀï¼ÓÈëÈçÏÂÄÚÈÝ£º
<servlet>
<servlet-name>proxoolServletConfigurator</servlet-name>
<servlet-class>org.logicalcobwebs.proxool.configuration.ServletConfigurator</servlet-class>
<init-param>
<param-name>xmlFile</param-name>
&
Ïà¹ØÎĵµ£º
ÑéÖ¤ÂëµÄÉú³É˼ÏëÊÇÔÚ·þÎñÆ÷¶ÎÔ¤ÏÈÉú³ÉºÃÑéÖ¤Â룬ǰ̨ÏÔʾ£¬È»ºóÔÙµ½ºǫ́ȥƥÅ䣡
code.jsp:
<%@ page language="java" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*"
contentType="image/jpeg" pageEncoding="UTF-8"%>
<% //ÉèÖÃÒ³Ãæ²»» ......
µÚÒ»ÖÖ JavaScriptÁ¬½ÓÊý¾Ý¿â£º
<mce:script language="JavaScript"><!--
// ´´½¨Êý¾Ý¿â¶ÔÏó
var objdbConn = new ActiveXObject("ADODB.Connection");
// DSN×Ö·û´®
var strdsn = "Driver={SQL Server};SERVER=192.168.0.210;UID=xhb;PWD=xhb;DATABASE=books";
// ´ò¿ªÊý¾ÝÔ´
objdbConn.Open(strdsn);
// ......
JSPµ÷ÓÃJavaBeanÔÚÍøÒ³É϶¯Ì¬Éú³ÉÖù״ͼ
ÎÒÃǾ³£ÒªÔÚÍøÒ³¿´µ½Ò»Ð©¶¯Ì¬¸üеÄͼƬ,×î³£¼ûµÄĪ¹ýÓÚ¹ÉƱµÄKÏßͼ£¬±¾ÎÄÊÔͼͨ¹ýÒ»¸ö¼òµ¥µÄʵÀý£¬Ïò´ó¼ÒչʾÈçºÎͨ¹ýJSP µ÷ÓÃJavaBeanÔÚÍøÒ³É϶¯Ì¬Éú³ÉÖù״ͼ¡£
¡¡¡¡±³¾°£º±¾ÈË×î½üÔÚΪijͳ¼Æ¾Ö¿ª·¢ÏîĿʱ,Éæ¼°µ½ÔÚÍøÒ³É϶¯Ì¬Éú³ÉͼƬµÄÎÊÌ⣬·ÑÁËÒ»ÌìµÄʱ¼ä,ÖÕÓڸ㶨,Ϊ°ïÖú´ó ......
JSP²ÊÉ«ÑéÖ¤Âë
Éú³ÉÓÐ4¸öËæ»úÊý×ÖºÍÔÓÂÒ±³¾°µÄͼƬ£¬Êý×ֺͱ³¾°ÑÕÉ«»á¸Ä±ä£¬·þÎñÆ÷¶ËˢУ¨ÓÃhistory.go(-1)Ò²»á±ä£©
ÔÐͲο¼ALIBABA http://china.alibaba.com/member/showimage
²úÉúÑéÖ¤ÂëͼƬµÄÎļþ-----image.jsp
<%@ page contentType="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,java ......