怎样用DOM解析XML文件,并且连接到数据库?
解决方案 »
- SSH框架搭建好。关于<listener>的问题
- 问一下论坛和问答是怎么做的
- 怎能样像迅雷看看哪样将一个层显示在屏幕中央
- 关于使用JDOM提取XML文件是的一个问题
- myelipse + struts 的简单问题
- Resin2.1.13+JDK1.4+MySQL5.0.27下通过Resin连接池访问数据源出现javax.naming.NameNotFoundException
- 怎么把一个整型专成字符型??
- 找不到类会是些什么原因?java.lang.ClassNotFoundException
- 在IE10下使用FCKEditor ,空格( )问题
- 初学者求指导
- spring不能操作的问题
- ssh 出现HTTP Status 404 - Servlet action is not available
File docFile = new File("**.xml");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();//生成一个DOM解析器
Document doc = db.parse(docFile);//得到XML文件的Document节点
Element root=doc.getDocumentElement();//得到XML文件的根节点