ʹÓÃDOM·½Ê½£¬Java½âÎöXML»ù±¾²½Öè:
Ê×ÏÈ£¬ÎÒÃÇÐèÒª½¨Á¢Ò»¸ö½âÎöÆ÷¹¤³§¡£
DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
È»ºó¿ÉÒÔÀûÓÃÕâ¸ö¹¤³§À´»ñµÃÒ»¸ö¾ßÌåµÄ½âÎö¶ÔÏó¡£
DocumentBuilder builder=dbf.newDocumentBuilder();
DocumentBuilderµÄParse()·½·¨½ÓÊÜÒ»¸öXMLÎĵµÃû×÷ΪÊäÈë²ÎÊý£¬·µ»ØÒ»¸öDocument¶ÔÏó¡£Document¶ÔÏó´ú±íÁË Ò»¸öXMLÎĵµµÄÊ÷Ä£ÐÍ¡£
Document doc=builder.parse("candiate.xml");
ʹÓÃDocument¶ÔÏóµÄgetElementsByTagName()·½·¨£¬ÎÒÃÇ¿ÉÒԵõ½Ò»¸öNodeList¶ÔÏó£¬ËûÊÇXMLÎĵµÖеıêÇ©ÔªËØ ÁÐ±í£¬¿ÉÒÔʹÓÃNodeList¶ÔÏóµÄitem()·½·¨À´µÃÁбíÖеÄÿһ¸öNode¶ÔÏó¡£
NodeList nl=doc.getElementsByTagName("PERSON");
Element node=(Element)nl.item(i);
×îºó£¬ÎÒÃÇ»áʹÓÃNode¶ÔÏóµÄgetNodeValue()·½·¨Ìáȡij¸ö±êÇ©ÄÚµÄÄÚÈÝ¡£
node.getElementsByTagName("NAME").item(0).getFirstChild().getNodeValue()
ÍêÕû³ÌÐò´úÂë:
import javax.xml.parsers.*;
import org.w3c.dom.*;
public class dom {
public static void main(String args[]){
String uri=args[0];
try{
DocumentBuilderFactory factory = DocumentBuilde ......
package com.gamvan.tools;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class FileOperate {
private String message;
public FileOperate() {
}
/**
* ¶ÁÈ¡Îı¾ÎļþÄÚÈÝ
* @param filePathAndName ´øÓÐÍêÕû¾ø¶Ô·¾¶µÄÎļþÃû
* @param encoding Îı¾Îļþ´ò¿ªµÄ±àÂ뷽ʽ
* @return ·µ»ØÎı¾ÎļþµÄÄÚÈÝ
*/
public String&nbs ......
½â¾ö°ì·¨£ºÔÚÁ¬½Ó×Ö·û´®ÖÐ˵Ã÷Á¬½Ó×Ö·ûµÄÊôÐÔ£¬È磺
<add name="server_mysql" connectionString="server=127.0.0.1;user id=root; password=123; database=baiduemail; pooling=false;charset=gbk"/>
»òÕßÊÇ;charset=gb2312
ÁíÍâ×¢Ò⣺ÔÚ´´½¨mysqlÊý¾Ý¿âµÄ±íµÄʱºòÑ¡Ôñ±àÂ뼯gbk ......
¹«Ë¾¿ª·¢ÁËÒ»¸öÍøÕ¾£¬¹À¼Æ×î¸ßÔÚÏßÈËÊýÊÇ3 Íò£¬²¢·¢ÈËÊý×î¶à100 ÈË¡£¿ª·¢µÄÍøÕ¾ÊÇ·ñÄÜ·ñ³ÐÊÜÕâ¸öѹÁ¦£¬ÈçºÎÈ·±£ÍøÕ¾µÄ¸ººÉûÓÐÎÊÌ⣬¾¹ýÑо¿¾ö¶¨ÈçÏ£º
£¨1 £©²ÉÓøºÔØƽºâºÍ¼¯Èº¼¼Êõ£¬³õ²½»ú¹¹²ÉÓÃApache Tomcat µÄ»úȺ¼¼Êõ¡£
£¨2 £©²ÉÓÃѹÁ¦²âÊÔ¹¤¾ß£¬²âÊÔѹÁ¦¡£¹¤¾ßÊÇLoadrunner.
Ó²¼þ»·¾³´î½¨£º
ΪÁËÄܹ»½øÐÐѹÁ¦²âÊÔ£¬ÐèÒª´î½¨Ò»¸ö»·¾³¡£¸Õ¿ªÊ¼Ê±£¬²âÊÔÔÚ¹«Ë¾¾ÖÓòÍøÄÚ½øÐУ¬µ«ºÜ¿ì·¢ÏÖÁËÒ»¸öÎÊÌ⣬¼´Ò»¸ö½Å±¾µÄѹÁ¦²âÊÔ½á¹ûÿ´Î¶¼²»Ò»Ñù£¬²¢ÇÒ²î±ðºÜ´ó¡£ÔÀ´ÊÇÊܹ«Ë¾ÍøÂçµÄÓ°Ï죬ÓÚÊǾö¶¨´î½¨Ò»¸öÍêÈ«¸ôÀëµÄ¾ÖÓòÍø²âÊÔ¡£´î½¨ºóµÄ¾ÖÓòÍøÅäÖÃÈçÏ£º
£¨1£© ÍøÂçËٶȣº100M
£¨2£© Èý̨
·þÎñÆ÷
£º
¸ºÔØ
·þÎñÆ÷
£º²Ù×÷ϵͳwindows2003£¬
Tomcat·þÎñÆ÷£º²Ù×÷ϵͳwindows2000 Professional
Êý¾Ý¿â·þÎñÆ÷£º²Ù×÷ϵͳwindows2000 Professional
Èý̨»úÆ÷µÄcpu 2.4 G, ÄÚ´æ 1G¡£
Èí¼þ»·¾³´î½¨£º
Èí¼þµÄ°æ±¾ÈçÏ£º
Apache °æ±¾£º2.054£¬
Tomcat5.0.30,
mysql £º4.1.14.
JDK1.5
ѹÁ¦²âÊÔ¹¤¾ß£ºLoadrunner7.8¡£
¸ºÔØƽºâ·½°¸ÈçÏ£º
һ̨»úÆ÷£¨²Ù×÷ϵͳ2003£©°²×°apache£¬×÷Ϊ¸ºÔØ·þÎñÆ÷£¬²¢°²×°tomcat×÷Ϊһ¸öworker£»Ò»¸öµ¥¶À°²×°tomcat£¬×÷ΪµÚ¶þ¸öworker£»Ê£Ï ......
¹«Ë¾¿ª·¢ÁËÒ»¸öÍøÕ¾£¬¹À¼Æ×î¸ßÔÚÏßÈËÊýÊÇ3 Íò£¬²¢·¢ÈËÊý×î¶à100 ÈË¡£¿ª·¢µÄÍøÕ¾ÊÇ·ñÄÜ·ñ³ÐÊÜÕâ¸öѹÁ¦£¬ÈçºÎÈ·±£ÍøÕ¾µÄ¸ººÉûÓÐÎÊÌ⣬¾¹ýÑо¿¾ö¶¨ÈçÏ£º
£¨1 £©²ÉÓøºÔØƽºâºÍ¼¯Èº¼¼Êõ£¬³õ²½»ú¹¹²ÉÓÃApache Tomcat µÄ»úȺ¼¼Êõ¡£
£¨2 £©²ÉÓÃѹÁ¦²âÊÔ¹¤¾ß£¬²âÊÔѹÁ¦¡£¹¤¾ßÊÇLoadrunner.
Ó²¼þ»·¾³´î½¨£º
ΪÁËÄܹ»½øÐÐѹÁ¦²âÊÔ£¬ÐèÒª´î½¨Ò»¸ö»·¾³¡£¸Õ¿ªÊ¼Ê±£¬²âÊÔÔÚ¹«Ë¾¾ÖÓòÍøÄÚ½øÐУ¬µ«ºÜ¿ì·¢ÏÖÁËÒ»¸öÎÊÌ⣬¼´Ò»¸ö½Å±¾µÄѹÁ¦²âÊÔ½á¹ûÿ´Î¶¼²»Ò»Ñù£¬²¢ÇÒ²î±ðºÜ´ó¡£ÔÀ´ÊÇÊܹ«Ë¾ÍøÂçµÄÓ°Ï죬ÓÚÊǾö¶¨´î½¨Ò»¸öÍêÈ«¸ôÀëµÄ¾ÖÓòÍø²âÊÔ¡£´î½¨ºóµÄ¾ÖÓòÍøÅäÖÃÈçÏ£º
£¨1£© ÍøÂçËٶȣº100M
£¨2£© Èý̨
·þÎñÆ÷
£º
¸ºÔØ
·þÎñÆ÷
£º²Ù×÷ϵͳwindows2003£¬
Tomcat·þÎñÆ÷£º²Ù×÷ϵͳwindows2000 Professional
Êý¾Ý¿â·þÎñÆ÷£º²Ù×÷ϵͳwindows2000 Professional
Èý̨»úÆ÷µÄcpu 2.4 G, ÄÚ´æ 1G¡£
Èí¼þ»·¾³´î½¨£º
Èí¼þµÄ°æ±¾ÈçÏ£º
Apache °æ±¾£º2.054£¬
Tomcat5.0.30,
mysql £º4.1.14.
JDK1.5
ѹÁ¦²âÊÔ¹¤¾ß£ºLoadrunner7.8¡£
¸ºÔØƽºâ·½°¸ÈçÏ£º
һ̨»úÆ÷£¨²Ù×÷ϵͳ2003£©°²×°apache£¬×÷Ϊ¸ºÔØ·þÎñÆ÷£¬²¢°²×°tomcat×÷Ϊһ¸öworker£»Ò»¸öµ¥¶À°²×°tomcat£¬×÷ΪµÚ¶þ¸öworker£»Ê£Ï ......
MysqlÔÚÔËÐÐÒ»¶Îʱ¼äºó£¬Ëæ×Å¿âÈÝÁ¿µÄÔö´ó£¬±íµÄÔö¶à£¬ÓеÄʱºòÒòΪµôµç»òÕßÆäËûÔÒòµ¼ÖÂÊý¾Ý¿âËð»µ,±ÈÈ磺 ¼ì²éÓÅ»¯²¢ÐÞ¸´ËùÓеÄÊý¾Ý¿â£¬ÎÒÃÇ¿ÉÒÔʹÓÃmysql×Ô´øµÄmysqlcheckÃüÁîÀ´¿ìËÙÐÞ¸´ËùÓеÄÊý¾Ý¿â»òÕßÌض¨µÄÊý¾Ý¿â; ½øÈëMysqlµÄBinĿ¼£ºd:\MySQL\MySQL Server 4.1\bin or /usr/bin/
(ls my* ÏÔʾmy¿ªÍ·µÄÎļþ£©(linux Ï¿âµÄµØÖ·ÔÚ/var/lib/mysql/£©
ÔËÐУºmysqlcheck -A -o -r -uroot -ppasswd
×¢Ò⣬½«rootÓû§ÃûºÍpasswdÃÜÂë¸ÄΪÄãµÄMySQLµÄÃÜÂë¡£ pw_* OK ÐÞ¸´ÓÐphpwindµÄ¿âµÄ±í
cdb_* OK ÐÞ¸´ÓÐDiscuzµÄ¿âµÄ±í
¡¡
¡¡
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
¡¡
¡¡
¡¡ ......