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

java ²Ù×÷XMLÎļþ£¨Æ¬¶Î£©

//create a new Document
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document d = db.newDocument();

//add root Node
Element noteuser = d.createElement("note-users");
d.appendChild(noteuser);

//add exists Node
Document readXML = db.parse(new File("c:\\note-user.xml"));
NodeList nl = readXML.getElementsByTagName("user");
for(int i = 0; i < nl.getLength(); i++)
{
Element n = d.createElement("user");
n.setAttribute("name", nl.item(i).getAttributes().getNamedItem("name").getNodeValue());
if(id !=null && id.equals(nl.item(i).getAttributes().getNamedItem("name").getNodeValue()))
{
//duplicate id (redirect to error page)
response.getWriter().print("<font color = red>duplicate id !</font>");
response.getWriter().print("      ");
response.getWriter().print("<a href = \"reg.jsp\">return to login page</a>");
return;
}
n.setAttribute("password", nl.item(i).getAttributes().getNamedItem("password").getNodeValue());
noteuser.appendChild(n);
}

//add regist Node
Element n = d.createElement("user");
n.setAttribute("name", id);
n.setAttribute("password", pwd);
noteuser.appendChild(n);

//save data to file
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
DOMSource source = new DOMSource(d);

//file's path
StreamResult result = new StreamResult(new File("c:\\note-user.xml"));
transformer.transform(source, resu


Ïà¹ØÎĵµ£º

sql 2005 ´æ´¢¹ý³Ì·ÖÒ³ java ´úÂë

 create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',         
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ ......

JAVA±Ê¼Ç£¨Î壩

javaÖеÄÐÞÊηû
static ±íʾ¾²Ì¬£¬Ëü¿ÉÒÔÐÞÊÎÊôÐÔ£¬·½·¨ºÍ´úÂë¿é¡£
1£¬staticÐÞÊÎÊôÐÔ£¨Àà±äÁ¿£©£¬ÄÇôÕâ¸öÊôÐԾͿÉÒÔÓà ÀàÃû.ÊôÐÔÃû À´·ÃÎÊ£¬Ò²¾ÍÊÇʹÕâ¸öÊôÐÔ³ÉΪ±¾ÀàµÄÀà±äÁ¿£¬Îª±¾Àà¶ÔÏóËù¹²ÓС£Õâ¸öÊôÐÔ¾ÍÊÇÈ«À๫ÓС££¨¹²ÓеÄÀà±äÁ¿Óë¶ÔÏóÎ޹أ¬Ö»ºÍÀàÓйأ©¡£
Àà¼ÓÔصĹý³Ì£¬Àà±¾ÉíÒ²ÊDZ£´æÔÚÎļþÖУ¨×Ö½ÚÂëÎļþ± ......

SAX½âÎöXML(Ô´´úÂ룩

package book.xml;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Stack;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.Default ......

MsXml´´½¨ºÍ½âÎöXMLʾÀý

Ò»£®MsXml´´½¨XMLÎĵµÊ¾Àý
 // XmlCreationDemo.cpp
#include <stdlib.h>
#include <stdio.h>
// ÒýÈëMSXML½âÎöÆ÷
#import <msxml4.dll>
using namespace MSXML2;
class InitializeCom
{
public:
InitializeCom() { CoInitialize(NULL); // Initializes the COM library }
~Initializ ......

javaµ¼Èëµ¼³öexcel²Ù×÷(jxl)


±¾ÎÄת×Ôhttp://kingsui.javaeye.com/blog/154712
javaµ¼Èëµ¼³öexcel²Ù×÷(jxl)
Java½âÊÍExcelÊý¾Ý£¨jxl.jar°üµÄʹÓã©
¹Ø¼ü×Ö: java excel jxl.jar
jxl.jar °ü
ÏÂÔصØÖ·:
http://www.andykhan.com/jexcelapi/
ÕæʵÏÂÔصØÖ·:
http://www.andykhan.com/jexcelapi/download.html
ÍøÕ¾É϶ÔËüµÄÌØÕ÷ÓÐÈçÏÂÃèÊö£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ