Apache Tomcat/5.0.28
把jdbc包拷贝到%TOMCAT_HOME%/common/lib下面,并将jdbc包加入到系统变量classpath。
server.XML的配置:
connector的配置属性添加 URIEncoding="UTF-8" 属性。
context的配置实例如下:
<ContextdocBase="E:\eclipse\workspace\tomcat\.deployables\tomcat"path=""reloadable="true"source="com.ibm.wtp.web.server:tomcat"
<LoggerclassName="org.apache.catalina.logger.FileLogger"
prefix="tomcat_log."suffix=".txt"
timestamp="true"/
<Resourcename="jdbc/SqlServer"
auth="Container"
type="Javax.sql.DataSource"
reloadable="true"/
<ResourceParamsname="jdbc/SqlServer"
<parameter
<namefactory</name
<valueorg.apache.commons.dbcp.BasicDataSourceFactory</value
</parameter
<parameter
<namemaxActive</name
<value100</value
</parameter
<parameter
<namemaxIdle</name
<value30</value
</parameter
<parameter
<namemaxWait</name
<value10000</value
</parameter
<parameter
<nameusername</name
<valuedev</value
</parameter
<parameter
<namepassWord</name
<valuedev</value
</parameter
<parameter
<namedriverClassName</name
<valuecom.microsoft.jdbc.sqlserver.SQLServerDriver</value
</parameter
<parameter
<nameurl</name
<valuejdbc:microsoft:sqlserver://192.168.0.7:1433;SelectMethod=cursor</value
</parameter
</ResourceParams
</Context
Apache Tomcat/5.5.9
server.xml的配置:
connector的配置属性添加 URIEncoding="UTF-8" 属性。
context的配置实例如下:
<ContextdocBase="E:\eclipse\workspace\khrscm_tomcat\.deployables\tomcat"path=""reloadable="true"source="com.ibm.wtp.web.server:tomcat"
<Resourcename="jdbc/SqlServer"auth="Container"type="javax.sql.DataSource"
maxActive="100"maxIdle="30"maxWait="10000"
username="dev"password="dev"driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://192.168.0.7:1433;SelectMethod=cursor"/
</Context