Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA¸ù¾ÝXML½Úµã¶ÁÈ¡XMLÎļþÄÚÈÝ

XMLÎļþ book.xml
<book>
<person>
<first>Kiran</first>
<last>Pai</last>
<age>22</age>
</person>
<person>
<first>Bill</first>
<last>Gates</last>
<age>46</age>
</person>
<person>
<first>Steve</first>
<last>Jobs</last>
<age>40</age>
</person>
</book>
³ÌÐòÊä³ö
Root element of the doc is book
Total no of people: 3
First Name: Kiran
Last Name: Pai
Age: 22
First Name: Bill
Last Name: Gates
Age: 46
First Name: Steve
Last Name: Jobs
Age: 40
³ÌÐòÇåµ¥
import java.io.File;
import org.w3c.dom.Document;
import org.w3c.dom.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
public class ReadAndPrintXMLFile{
    public static void main (String argv []){
    try {
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse (new File("book.xml"));
            // normalize text representation           
            doc.getDocumentElement ().normalize ();
            System.out.println ("Root element of the doc is " + doc.getDocumentElement().getNodeName());
            NodeList listOfPersons = doc.getElementsByTagName("person");
     


Ïà¹ØÎĵµ£º

JAVAÊÕ¼¯

1.vectorÊÇÏß³Ìͬ²½µÄ£¬ËùÒÔËüÒ²ÊÇḬ̈߳²È«µÄ£¬¶øarraylistÊÇÏß³ÌÒì²½µÄ£¬ÊDz»°²È«µÄ¡£Èç¹û²»¿¼Âǵ½Ï̵߳ݲȫÒòËØ£¬Ò»°ãÓÃarraylistЧÂʱȽϸߡ£ 2.Èç¹û¼¯ºÏÖеÄÔªËØµÄÊýÄ¿´óÓÚĿǰ¼¯ºÏÊý×éµÄ³¤¶Èʱ£¬vectorÔö³¤ÂÊΪĿǰÊý×鳤¶ÈµÄ100%,¶øarraylistÔö³¤ÂÊΪĿǰÊý×鳤¶ÈµÄ50%.Èç¹ýÔÚ¼¯ºÏÖÐʹÓÃÊý¾ÝÁ¿±È½Ï´óµÄÊý¾Ý£¬ÓÃvecto ......

oracleµ÷ÓÃjava³ÌÐòÁ¬sqlserver2005

1¡¢ÔÚoracleµÄsys-sysdbaϵǽ
дһ¸öjava source³ÌÐòÁ´½Ósqlserver2005£º
create or replace and compile java source named test as
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class excutesql1
{
    public static String entry ......

RabbitÁ÷ÃÜÂëµÄJavaʵÏÖ

1. RabbitÁ÷ÃÜÂ루Rabbit Stream Cipher£©¼ò½é
      RabbitÁ÷ÃÜÂëÊÇÓÉCryptico¹«Ë¾£¨http://www.cryptico.com£©Éè¼ÆµÄ£¬ÃÜÔ¿³¤¶È128룬
×î´ó¼ÓÃÜÏûÏ¢³¤¶ÈΪ264 Bytes£¬¼´16 TB£¬ÈôÏûÏ¢³¬¹ý¸Ã³¤¶È£¬ÔòÐèÒª¸ü»»ÃÜÔ¿¶ÔʣϵÄÏûÏ¢½øÐд¦Àí¡£ËüÊÇĿǰ°²È«ÐԽϸߣ¬¼Ó/½âÃÜËٶȱȽϸßЧµÄÁ÷ÃÜÂëÖ®Ò»£ ......

JAVA¿ª·¢Õß×ȥµÄ20¸öÓ¢ÎÄÍøÕ¾

1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ – ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í.
4.[http:/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ