JAVAÖжÁÈ¡XMLÎļþÖеÄÅäÖÃÐÅÏ¢
ÔÚ½øÐÐMISϵͳ¿ª·¢¹ý³ÌÖÐ,´ÓÅäÖÃÎļþÖжÁÈ¡ÅäÖÃÐÅÏ¢ÊÇÿһ¸öϵͳ±ØÐë¾ß±¸µÄ¹¦ÄÜ,ÀýÈç,ÎÒÃÇÒªÅäÖöÁÈ¡Êý¾Ý¿âÅäÖÃÐÅÏ¢,°üÀ¨Çý¶¯³ÌÐòÃû¡¢Á¬½Ó×Ö·û´®£¬Óû§Ãû£¬¿ÚÁîµÈÐÅÏ¢£¬ÓÉÓÚÕâЩÐÅÏ¢»áËæ×ÅÓû§µÄ²»Í¬¶ø·¢Éú¸Ä±ä£¬ËùÒÔ²»ÄÜÖ±½Ó°Ñ²ÎÊýдÔÚ³ÌÐòÖУ¬½«ÆäдÈëÅäÖÃÎļþ£¬È»ºóÔÚÓ¦ÓóÌÐòÖжÁÈ¡ÅäÖÃÐÅÏ¢²¢¼ÓÒÔʹÓã¬ÊÇÒ»¸ö³ÉÊìµÄMISϵͳ±ØÐë¾ßÓеĻù±¾¹¦ÄÜ¡£
JAVAÓëXMLÎļþ£¬¿ÉÒÔ˵ÊÇÈí¼þ¿ª·¢µÄ“»Æ½ð´îµµ”£¬¶øÈçºÎʹÓÃJAVAÍê³É¶ÔXMLÎļþµÄ¶ÁÈ¡£¬ÊÇÎÒÃÇÊ×ÏÈÒª½â¾öµÄÎÊÌâ¡£
Ò»¡¢XMLÎļþ
Õâ¸öʾÀýÎļþ°üÀ¨ÁËÓÃÀ´´ò¿ªORACLEÊý¾Ý¿âµÄ¸÷ÖÖ²ÎÊý
<?xml version="1.0" encoding="UTF-8"?>
<dbmsg>
<dbinfo>
<drivername>oracle.jdbc.driver.OracleDriver</drivername>
<sConnStr>jdbc:oracle:thin:@11.88.225.80:1521:VOUCHERDB</sConnStr>
<username>SYS AS SYSDBA</username>
<password>voucherdb</password>
</dbinfo>
</dbmsg>
¶þ¡¢±àдÀàÃûΪReadXmlµÄÀ࣬ÓÃÓÚ½âÎöXMLÎļþ
ÎÒÃÇÒªÔÚÓ¦ÓóÌÐòÖдò¿ªÊý¾Ý¿â£¬¾Í±ØÐëÍê³É¶Ô¸ÃÎļþÖÐdrivername¡¢sConnStr¡¢username¡¢passwordµÄ¶ÁÈ¡£¬Í¨¹ý²éÕÒÓйØ×ÊÁÏ£¬±ÊÕß±àÖÆÁËÒÔϳÌÐò£¬ÓÃÓÚ¶ÁÈ¡ÎļþÃûΪfilenameµÄXMLÎļþ¡£
package voucher.basic;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class ReadXml {
private String drivername;
private String sConnStr;
private String username;
private String password;
public String getDrivername() {
return drivername;
}
public String getSConnStr() {
return sConnStr;
}
public String getUser
Ïà¹ØÎĵµ£º
GUIDÊÇÒ»¸ö128볤µÄÊý×Ö£¬Ò»°ãÓÃ16
½øÖƱíʾ¡£Ëã·¨µÄºËÐÄ˼ÏëÊǽáºÏ»úÆ÷µÄÍø¿¨¡¢µ±µØʱ¼ä¡¢Ò»¸öËæ¼´ÊýÀ´Éú³ÉGUID¡£´ÓÀíÂÛÉϽ²£¬Èç¹ûһ̨»úÆ÷ÿÃë²úÉú10000000¸öGUID£¬Ôò¿ÉÒÔ
±£Ö¤£¨¸ÅÂÊÒâÒåÉÏ£©3240Äê²»Öظ´¡£
UUIDÊÇ1.5ÖÐÐÂÔöµÄÒ»¸öÀ࣬ÔÚjava.utilÏ£¬ÓÃËü¿ÉÒÔ²úÉúÒ»¸öºÅ³ÆÈ«ÇòΨһµÄID
package
com.mytest;
im ......
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ÇÒÔÊÐíºÍ¹ÄÀøÀàµÄÖØ ......
JavaÊý×éÊÇÒ»¸öJava¶ÔÏó£¬Êý×éµÄ³¤¶ÈÊǹ̶¨µÄ£¬ÔÚͬһ¸öÊý×éÖÐÖ»Äܹ»´æ·ÅÏàͬÀàÐ͵ÄÊý¾Ý£¬Êý×é¿ÉÒÔ´æ·Å»ù±¾ÀàÐ͵ÄÊý¾Ý£¬Ò²¿ÉÒÔ´æ·ÅÒýÓÃÀàÐ͵ÄÊý¾Ý¡£ÔÚ´´½¨Êý×é¶ÔÏóʱ£¬±ØÐëÖ¸¶¨Êý×é¶ÔÏóµÄ³¤¶È£¬Êý×éÒ»µ©´´½¨£¬ËüµÄ³¤¶È¾Í²»ÄÜÔÙ±ä
£¨1£©´´½¨Êý×é¶ÔÏ󣨼´newÒ»¸öÊý×éʱ£©ÒªÖ¸¶¨Êý×éµÄ³¤¶È£¬Êý×éµÄ³¤¶ÈÒ»µ©Ö¸¶¨ ......
¡¾Ò»¡¿»ùÓÚ×Ö½ÚµÄÊäÈëÁ÷
ÖµµÃ×¢ÒâµÄµØ·½ÓУº
¢ÙLevel 2µÄÊäÈëÁ÷£¬´ó¶àÊý¶¼»áÖ¸Ã÷Êý¾ÝÔ´µÄÐÎʽ£ºÀýÈçByteArray£¬File£¬Piped
¢ÚLevel 3µÄÊäÈëÁ÷£¬Ôò²»»á³öÏÖ¾ßÌåµÄÊý¾ÝÔ´Ãû×Ö£¬¶øÊÇÒÔ¹¦ÄÜÈ¡´ú£ºÀýÈçBuffered£¬LineNumber
ËùÒÔ˵Level 3µÄÊäÈëÁ÷ÊǶÔLevel 2ÊäÈëÁ÷µÄ“·â×°ºÍ¹ýÂË”¡£Êµ¼ÊÉÏLevel 2µÄÊäÈëÁ÷£¬¶¼¼ ......