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");
 
Ïà¹ØÎĵµ£º
ÎÒÏÖÔÚÒѾ´óËÄÁË£¬Ñ§µÄÊÇÈí¼þרҵ£¬ÎÒ±ØÐë³ÐÈÏÎÒÃÇѧУµÄÈí¼þרҵºÜ²»ºÃ£¬ËùÒԴ󲿷ÖÒª¿¿×Ô¼º¡£
ÒÔÇ°´ÓÀ´Ã»Ð´¹ý²©¿Í£¬Õâ´ÎÔÚÕâÀ↑²©¾ÍÊÇÏëͨ¹ýcsdn½áʶ¸ü¶àµÄѧϰJAVAµÄÅóÓÑ£¬ÎÒÉîÖª×Ô¼ºµÄJAVA¹¦µ×Éõdz£¬ËùÒÔÖ»ÓÐ×Î×β»¾ëµÄÏ°£¬ºÍ²»ÑáÆä·³µÄ·¢ÎʲÅÄÜʹ×Ô¼ºÇ¿´ó¡£
×î½üÎÒÒ²´ÓÍøÉ ......
load-on-startupÔªËØÒ»°ãÊÇÅäºÏservletµÄÅäÖÃʹÓõÄ,load-on-startup ÔªËØÔÚwebÓ¦ÓÃÆô¶¯µÄʱºòÖ¸¶¨ÁËservlet±»¼ÓÔصÄ˳Ðò£¬ËüµÄÖµ±ØÐëÊÇÒ»¸öÕûÊý¡£Èç¹ûËüµÄÖµÊÇÒ»¸ö¸ºÕûÊý»òÊÇÕâ¸öÔªËز»´æÔÚ£¬ÄÇôÈÝÆ÷»áÔÚ¸Ãservlet±»µ÷ÓõÄʱºò£¬¼ÓÔØÕâ¸öservlet ¡£Èç¹ûÖµÊÇÕýÕûÊý»òÁ㣬ÈÝÆ÷ÔÚÅäÖõÄʱºò¾Í¼ÓÔز¢³õʼ»¯ ......
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 ......
ÏÖÔںܶàÈ˶¼ÎÊ C++ºÍJava ÄĸöºÃ. Æäʵ¼¼ÊõÉϸ÷Óи÷µÄºÃ´¦Óë²»×ã,ÎÒÏë´ó¼ÒËù˵µÄºÃ²»ºÃÖ¸µÃÊÇǰ;ºÃ²»ºÃ,׬µÄ¶à²»¶à.
Ҫ˵׬Ǯ×î¶àµÄ¿Ï¶¨ÊÇC++ÁË.ÒòΪһÃż¼ÊõÊÇ·ñֵǮȫ¿´»áËüµÄÈËÓжàÉÙ¶ø²»ÔÚÓÚÕâ¸ö¼¼Êõ±¾ÉíµÄºÃ»µ. C++Éæ¼°Ó²¼þµ×²ãµÄ¶«Î÷±È½Ï¶à,ѧÆðÀ´ºÜ¸´ÔÓ,»áµÄÈËÉÙ,ËùÒÔֵǮ.
&nb ......