关于tomcat5+mysql3.23.39-nt连接池的字符编码设置问题
我看MySQL Connector/J Documentation中说的
The JDBC URL format for MySQL Connector/J is as follows, with items in square brackets ([, ]) being optional:
jdbc:mysql://[host][,failoverhost...][:port]/[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
也就是说多个参数要用"&"连接
server.xml的部分代码
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/struts?useUnicode=true&characterEncoding=gb2312</value>
</parameter>
然后启动tomcat
有如下部分错误信息
2004-7-18 11:36:37 org.apache.commons.digester.Digester fatalError
服务器: Parse Fatal Error at line 423 column 91: The reference to entity "charac
terEncoding" must end with the ';' delimiter.
org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must
end with the ';' delimiter.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
所以我将“&”改成了“;”
这到底是为什么啊?怎么会出现这种现象?