java ¶ÔxmlµÄÔöɾ¸Ä²é
<?xml version="1.0" encoding="UTF-8"?>
<root>
<person id="1">
<username >xiaoma</username>
<password>xiaoma</password>
</person>
<person id="2">
<username>manager</username>
<password>password2</password>
</person>
<person id="3">
<username>hello</username>
<password>woerld</password>
</person>
</root>
*****************************
package com.test;
import java.io.*;
import java.util.*;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
/**
* xmlµÄÔöɾ¸Ä²éÖ®SAXBuilder
*
* @author Administrator
*
*/
public class XmlTest {
// ²éѯËùÓеÄÊý¾Ý
public static void list() throws JDOMException, IOException {
SAXBuilder builder = new SAXBuilder();
String xmlPath = "message.xml";
// String xmlPath = "./WebRoot/xml/message.xml";
// »ñµÃÎĵµ¶ÔÏó
Document document = builder.build(xmlPath);
// »ñµÃ¸ù½Úµã
Element root = document.getRootElement();
List list = root.getChildren();
System.out.println("root : " + root);
System.out.println("root.getName : " + root.getName());
System.out.println("listSize : " + list.size());
Iterator it = list.iterator();
while (it.hasNext()) {
Element e = (Element) it.next();
System.out.println("ID: " + e.getAttributeValue("id"));
System.out.println("childUsername:" + e.getChildText("username"));
System.out.println("childPassword:" + e.getChildText("password"));
}
// for(int i=0;i<list.size();i++){
// Element e = (Element)list.get(i
Ïà¹ØÎĵµ£º
Ò»¡¢ ¼ò½é
Berkeley DB Java Edition (JE)ÊÇÒ»¸öÍêÈ«ÓÃJAVAдµÄ£¬ËüÊʺÏÓÚ¹ÜÀíº£Á¿µÄ£¬¼òµ¥µÄÊý¾Ý¡£
Äܹ»¸ßЧÂʵĴ¦Àí1µ½1°ÙÍòÌõ¼Ç¼£¬ÖÆÔ¼JEÊý¾Ý¿âµÄÍùÍùÊÇÓ²¼þϵͳ,¶ø²»ÊÇJE±¾Éí¡£
¶ ......
Berkely DB¶ÔÓڸ߲¢·¢¡¢ÒªÇóËٶȿìµÄÓ¦ÓÃÀ´ËµÊǸö²»´íµÄÑ¡Ôñ£¬mysql¾ÍÊÇÓÃBDBʵÏÖµÄ(mysqlµÄºǫ́) £¬mysql¿ì£¬BDB±Èmysql»¹Òª¿ìN±¶¡£BDBÊÇÒ»ÖÖǶÈëʽµÄ¡¢·Ç¹ØϵÊý¾Ý¿â£¬ËüÓëÆäËûµÄ¹ØϵÊý¾Ý¿âRMDBS²»Í¬,ËüûÓÐÌṩSQL,¶øÊÇÌṩÁË×Ô¼ºµÄ·ÃÎʽӿڡ£×÷ΪһÖÖǶÈëʽµÄÊý¾Ý¿â£¬ËüÊǽø³ÌÄÚģʽµÄ£¬Ò²¾ÍÊÇ˵ËüºÍÓ¦ÓóÌÐòÔÚͬһÄÚ´æ¿ ......
ÎÒдÁËÒ»¸ö³ÌÐòÓÃÀ´½ÓÊÕ¿Í»§¶Ë·¢¹ýÀ´µÄÊý¾Ý£¬µ«ÊÇÈç¹û¶à¸ö¿Í»§¶ËÒ»ÆðÏñÕâÀï·¢ËÍÊý¾Ýʱ£¬±¨StandardWrapperValve[xmlreceiver]: Servlet.service() for servlet xmlreceiver threw exception java.lang.OutOfMemoryError£¬ÕâʱÐèÒªÀ©´ótomcatµÄjavaÐéÄâ»úÄڴ棬ÈçºÎ¸ü¸ÄÄØ£¿
ÔÚ Windows²Ëµ¥ÖÐÕÒµ½Tomcat°²×°²Ëµ¥ÖеÄMonitor ......
Õâ¸öÊÇ×Ô¼º¹ýȥΪÁË·½±ã²Ù×÷excelÊý¾Ý,дµÄÒ»¸ö¹¤¾ßÀà,ûÓÐÓÅ»¯¹ý,ºÇºÇ
ÉÏÃæµÄÊǹ¤¾ßÀà,ÏÂÃæÌáÓ÷¨,д·¨ºÜ±¿,µ«ÓÃ×Å»¹ºÜ·½±ã
package com.dtb.utils;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Array ......
ÒøÐбÊÊÔÌâ¼°´ð°¸:java±ÊÊÔÌâ¼°´ð°¸
1¡¢×÷ÓÃÓòpublic,private,protected,ÒÔ¼°²»Ð´Ê±µÄÇø±ð
´ð£º
Çø±ðÈçÏ£º
×÷ÓÃÓò µ±Ç°Àà ͬһpackage ×ÓËïÀà &n ......