求高手帮忙,在线等~ 利用java将数据库表的内容导出生成XML 然后抛出了异常,指向: Document doc= builder
想不通为什么这样~~求高手解答!!!!2012-05-20-12-26-14F:\XML\students_students_2012-05-20-12-26-14.xm...
想不通为什么这样~~求高手解答!!!!
2012-05-20-12-26-14
F:\XML\students_students_2012-05-20-12-26-14.xml[Fatal Error] :1:1: Premature end of file.
org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
at DBToXML.DTX(DBToXML.java:87)
at UI.actionPerformed(UI.java:64)
at java.awt.Button.processActionEvent(Button.java:392)
at java.awt.Button.processEvent(Button.java:360)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
导入失败!! at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 展开
2012-05-20-12-26-14
F:\XML\students_students_2012-05-20-12-26-14.xml[Fatal Error] :1:1: Premature end of file.
org.xml.sax.SAXParseException: Premature end of file.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
at DBToXML.DTX(DBToXML.java:87)
at UI.actionPerformed(UI.java:64)
at java.awt.Button.processActionEvent(Button.java:392)
at java.awt.Button.processEvent(Button.java:360)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
导入失败!! at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 展开
4个回答
展开全部
可能是XML文件编码问题,检查一下XML文件编码与XML声明是否一致,解析XML时的编码是否与XML文件一致。
希望能帮到你!
希望能帮到你!
追问
谢谢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
呃。问题先不解决。如果是mysql,其实可以直接导出xml。
mysql -uroot -pxxx --xml --default-character-set=utf8 "--execute=select * from table1;" mysqldb -> d:/haha.xml
mysql -uroot -pxxx --xml --default-character-set=utf8 "--execute=select * from table1;" mysqldb -> d:/haha.xml
追问
谢谢
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
要不直接用工具 要不用DOM4J 要不用数据库命令
追问
谢谢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用图形工具,直接可以导出
追问
谢谢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询