数据库中文问题

03-10-10 jorrey
安装了版主给的最新的jdon,但所有入库的中文都是?????。我想修改jive_config.xml中:

<serverURL>jdbc:mysql://localhost:3306/jive?useUnicode=true&characterEncoding=gb2312

</serverURL>

但打开首页时出错:

Caused by: org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.

at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213)

at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:579)

at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:1257)

at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)

at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)

at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:371)

at org.jdom.input.SAXBuilder.build(SAXBuilder.java:354)

at org.jdom.input.SAXBuilder.build(SAXBuilder.java:707)

at org.jdom.input.SAXBuilder.build(SAXBuilder.java:689)

at com.jivesoftware.forum.util.XMLProperties.<init>(XMLProperties.java:61)

at com.jivesoftware.forum.JiveGlobals.loadProperties(JiveGlobals.java:281)

at com.jivesoftware.forum.JiveGlobals.getJiveProperty(JiveGlobals.java:242)

at org.apache.jsp.error$jsp._jspService(error$jsp.java:104)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)

at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:414)

at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:452)

at org.apache.jsp.index$jsp._jspService(index$jsp.java:1295)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)

at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)

at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)

at java.lang.Thread.run(Thread.java:534)

为什么?

jorrey
2003-10-10 23:09
问题解决了:

1.忘记了在xml中&必须转意,即必须使用&

2.采用ISO8859_1字符集

即:

<serverURL>jdbc:mysql://localhost:3306/jive?useUnicode=true&characterEncoding=ISO8859_1

</serverURL>

tiger2004
2003-10-31 14:15
谢谢老大

猜你喜欢