½áºÏ·´ÉäÓë XML ʵÏÖ Java ±à³ÌµÄ¶¯Ì¬ÐÔ
·´ÉäÊÇ Java ÓïÑÔ±»ÊÓΪ¶¯Ì¬»ò×¼¶¯Ì¬ÓïÑÔµÄÒ»¸ö¹Ø¼üÐÔÖÊ£¬½áºÏ·´ÉäºÍ XML »á°ïÖúÎÒÃǸü¿ì¡¢¸ü·½±ãµØʵÏÖһЩ¶¯Ì¬´úÂ룬´Ó¶ø½â¾ö±à³ÌÖпÉÄÜÓöµ½µÄ²»È·¶¨ÎÊÌâ¡£±¾ÎĽ«½áºÏ·´ÉäÓë XML ¶Ô Java ±à³ÌµÄ¶¯Ì¬ÐÔ½øÐÐÉîÈëdz³öµÄÌÖÂÛ¡£ÔÚÀí½â±¾ÎĵÄ˼ÏëÖ®ºó£¬Äú¿ÉÒÔ½«ÆäÓ¦Óõ½³ÌÐòÖÐÒÔ´´½¨Áé»îµÄ´úÂë¡£
ÒýÑÔ
ÔÚÏÖʵÉú»îÖУ¬¾³£»á·¢ÉúÕâÖÖÇé¿ö¡£ÎÒҪȥÉ̳¡Âò²ËÀ´×¼±¸Íí²Í£¬ÎÒ²»ÖªµÀÂòʲô£¬µ«ÊǽøÈëÉ̳¡Ö®Ç°ÎÒ»áËæÊÖÄÃÒ»¸ö¹ºÎï¿ðÀ´×°×îÖÕ¾ö¶¨ÒªÂòµÄÎïÆ·£¬ÕâÑù²»¹ÜÎÒÂòʲô¶¼¿ÉÒÔ·ÅÈëÆäÖУ¬½áÕËÖ®ºó¾Í¿ÉÒÔ´ø»Ø¼Ò×¼±¸Íí·¹¡£ÔÚ¿ª·¢³ÌÐò¹ý³ÌÖУ¬Ò²»áÓöµ½ÀàËÆÇé¿ö¡£ÓÐʱÎÒÃDz»ÄÜÈ·¶¨ÀàµÄÃû³Æ¡¢ÀàÓÐÄÄЩÊôÐÔÒÔ¼°ÊôÐÔµÄÖµµÈ£¬ÕâЩÄÚÈÝÖ»Óе½ÔËÐеÄʱºò²ÅÄÜÈ·¶¨¡£ÕâÖÖÇé¿öÏ£¬²»Äܽ«ÀàµÄÃû³ÆÖ±½Ó¹Ì»¯£¬ÄÇôÔõÑù²ÅÄܽâ¾öÕâÖÖÎÊÌâÄØ£¿Æäʵ¿ª·¢³ÌÐòÓëÏÖʵÉú»îÓÐÏàËÆÖ®´¦¡£ÔÚ±à³ÌÖ®ÖУ¬¹ºÎï¿ð¾ÍºÃ±ÈÊÂÏÈ×¼±¸ºÃµÄͨÓýӿڣ¬Õâ¸ö½Ó¿Ú¿ÉÒÔÓ÷´ÉäµÄ»úÖÆÀ´ÊµÏÖ£¬¶ø¹ºÎï¿ðÖеIJ˿ÉÒÔÓÉ XML ÎļþÀ´ÃèÊö£¬ÕâÑù²»¹ÜÂòµÄ²ËÊÇʲô£¬ÎÒ¶¼¿ÉÒÔ´Ó¹ºÎï¿ðÖÐÈ¡³ö½ø¶ø×¼±¸Íí²Í¡£
»ùÓÚÉÏÊöÎÊÌ⣬±¾ÎĽ«½áºÏ·´ÉäÓë XML ¶Ô Java ±à³ÌµÄ¶¯Ì¬ÐÔ½øÐÐÉîÈëdz³öµÄÌÖÂÛ¡£ÔÚÀí½â±¾ÎĵÄ˼ÏëÖ®ºó£¬Äú¿ÉÒÔ½«ÆäÓ¦Óõ½³ÌÐòÖÐÒÔ´´½¨Áé»îµÄ´úÂë¡£
¼òҪ˵Ã÷
·´ÉäÊÇ Java ÓïÑÔ±»ÊÓΪ¶¯Ì¬»ò×¼¶¯Ì¬ÓïÑÔµÄÒ»¸ö¹Ø¼üÐÔÖÊ£¬Í¨¹ýÕâ¸ö»úÖÆÎÒÃÇ¿ÉÒÔÔÚÔËÐÐʱ¼ÓÔØ¡¢Ì½Öª¡¢Ê¹ÓñàÒëÆÚ¼äÍêȫδ֪µÄÀà¡£Õâ¸ö»úÖÆÔÊÐí³ÌÐòÔÚÔËÐÐʱ·´Éä¼ÓÔØÒ»¸öÀà»ò͸¹ý Reflection API È¡µÃÈκÎÒ»¸öÒÑÖªÃû³ÆµÄÀàµÄÄÚ²¿ÐÅÏ¢£¬°üÀ¨Æä modifiers£¨ÀýÈç public,static µÈµÈ£©¡¢superclass£¨ÀýÈç Object£©¡¢ÊµÏÖÖ® interfaces£¨ÀýÈç Cloneable£©£¬Ò²°üÀ¨ fields ºÍ methods µÄËùÓÐÐÅÏ¢¡£Èç¹ûÎÒÃÇÀûÓ÷´Éä½áºÏ XML ÖеÄһЩÅäÖÃÐÅÏ¢£¬¾Í¿ÉÒÔ×öµ½ÔËÐÐʱ¼ÓÔØ¡¢Ì½ÖªºÍ×°ÅäÀ࣬½«²»¿ÉÈ·¶¨µÄÒòËØÔÚÔËÐÐʱȷ¶¨»¯¡£
Èç¹ûÏëÁ˽â¸ü¶à¹ØÓÚ Java ±à³Ì¶¯Ì¬ÐÔµÄÄÚÈÝ£¬Äú¿ÉÒԲο¼ Dennis Sosnoski ¹ØÓÚ Java ±à³Ì¶¯Ì¬·½Ãæ µÄϵÁÐÎÄÕ¡£ÁíÍ⣬±¾ÎĽ«Ê¹Óà dom4j ¶Ô XML Îļþ½øÐдæÈ¡²Ù×÷¡£dom4j ÊÇÒ»¸ö·Ç³£·Ç³£ÓÅÐãµÄ Java XMLAPI£¬¾ßÓÐÐÔÄÜÓÅÒì¡¢¹¦ÄÜÇ¿´óºÍ¼«¶ËÒ×ÓÃʹÓõÄÌص㡣Èç¹ûÄú»¹Ã»ÓÐ dom4j.jar£¬ÄÇôÇëÏÈ ÏÂÔØ DOM4J ²¢½«Æäµ¼Èëµ½ÄúµÄ¹¤³ÌÖС£ÎªÁËÖ§³Ö xpath£¬Äú»¹ÐèÒª ÏÂÔØ jaxen-xxx.jar ²¢½«Æäµ¼Èëµ½¹¤³Ì¡£
ʾÀý¿ª·¢
»ùÓÚÉÏÊöÎÊÌ⣬ΪÁ˱ãÓÚÀí½â¸Ã½â¾ö·½°¸£¬ÎÒÃDZàд¼òµ¥µÄʾÀý´úÂëÀ´½øÐвûÊö¡£
¶ÔÓÚ¹ºÎï¿ð£¬ÓÃÀà Basket À´´ú±í£¬Æä´úÂëÈçÏÂËùʾ£¬°üÀ
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
public class Base64 {
//Âë±í
static private char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
.toCharArray();
&nb ......
package com.svse.dao;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class UserDAO {
/*
* javaµ÷Óô洢¹ý³Ì
*/
public int addUser(String username,int userage)
{
Connection conn = null;
int useri ......
±¾ÎĽ²Êö³ÌÐò¿ª·¢ÕßÔõÑùʹÓÃNetBeans 6.8 IDEºÍJavaFX¼¼Êõ´´½¨ËûÃǵĵÚÒ»¸öJavaFXÓ¦ÓóÌÐò¡£ÔÚÎÄÕÂÖУ¬ÎÒÃǽ«´´½¨Ò»¸ö¼òµ¥µÄ´øÓÐÎı¾µÄÇòÌå¡£¸ÃÇòÌåÔÚÒ»¸öÌض¨µÄʱ¼äÖÜÆÚÄڸıäÆä͸Ã÷¶È¡£Ä㻹¿ÉÒÔʹÓÃÊó±êÍ϶¯ÇòÌå¡£
ͬÑùµÄÔÒò£¬ÒòΪÎÄÄÚÓкܶà²Ù×÷½Øͼ£¬ÕâÀï²åÈëºÜ²»·½±ã£¬ ......
JavaÕýÔò±í´ïʽµÄÓ¦Óã¬ÕâÀïÖ÷ÒªÓõ½ÁËPatternÀà¡£
Ô´ÂëÈçÏÂ:
package quiz;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* JavaÕýÔò±í´ïʽʾÀý
* */
public class RegularExpressionPattern {
public static void main(String[] args) {
//1.²ÉÓÃPattern.LITERALģʽ,
Patter ......