Apache Tomcat/
把jdbc包拷贝到%TOMCAT_HOME%/common/lib下面并将jdbc包加入到系统变量classpath
serverxml的配置
connector的配置属性添加 URIEncoding=UTF 属性
context的配置实例如下
<ContextdocBase=E:\eclipse\workspace\tomcat\deployables\tomcatpath=reloadable=truesource=comibmwtpwebserver:tomcat>
<LoggerclassName=orgapachecatalinaloggerFileLogger
prefix=tomcat_logsuffix=txt
timestamp=true/>
<Resourcename=jdbc/SqlServer
auth=Container
type=javaxsqlDataSource
reloadable=true/>
<ResourceParamsname=jdbc/SqlServer>
<parameter>
<name>factory</name>
<value>monsdbcpBasicDataSourceFactory</value>
</parameter>
<parameter>
<name>maxActive</name>
<value></value>
</parameter>
<parameter>
<name>maxIdle</name>
<value></value>
</parameter>
<parameter>
<name>maxWait</name>
<value></value>
</parameter>
<parameter>
<name>username</name>
<value>dev</value>
</parameter>
<parameter>
<name>password</name>
<value>dev</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>commicrosoftjdbcsqlserverSQLServerDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:microsoft:sqlserver://:;SelectMethod=cursor</value>
</parameter>
</ResourceParams>
</Context>
Apache Tomcat/
serverxml的配置
connector的配置属性添加 URIEncoding=UTF 属性
context的配置实例如下
<ContextdocBase=E:\eclipse\workspace\khrscm_tomcat\deployables\tomcatpath=reloadable=truesource=comibmwtpwebserver:tomcat>
<Resourcename=jdbc/SqlServerauth=Containertype=javaxsqlDataSource
maxActive=maxIdle=maxWait=
username=devpassword=devdriverClassName=commicrosoftjdbcsqlserverSQLServerDriver
url=jdbc:microsoft:sqlserver://:;SelectMethod=cursor/>
</Context>