java½âÎöxml
Ìâ¼Æ£ºÕâÀï¸ø³öjava½âÎöxml£¬ÒÔ°ïÖúÈËÃÇÀí½âÐí¶àÈÝÆ÷ÊÇÔõô×öµÄ¡£¡£Ïñspring£¬strutsµÈ.
1.mysql.xml´úÂ룺
<?xml version="1.0" encoding="UTF-8"?>
<data>
<datasource>
<servername>localhost</servername>
<serverport>3306</serverport>
<databasename>juddi</databasename>
<username>root</username>
<password>123456</password>
</datasource>
</data>
2.XMLÅäÖÃÎļþ½âÎöÆ÷,Ö÷ҪĿµÄ£¬ÊÇΪ×öÇ°ÆÚ¹¤×÷
package com;
/*
* XMLÅäÖÃÎļþ½âÎöÆ÷,Ö÷ҪĿµÄ£¬ÊÇΪ×öÇ°ÆÚ¹¤×÷
*/
import org.xml.sax.helpers.DefaultHandler;
import java.util.Properties;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
public class ConfigParser extends DefaultHandler {
//¶¨ÒåÒ»¸öpropertiesÓÃÀ´´æ·ÅÊôÐÔ
private Properties props;
private String currentName;
private StringBuffer currentValue=new StringBuffer();
public ConfigParser(){
this.props=new Properties();
}
public Properties getProps(){
return this.props;
}
//ÕâÀïÊǽ«xmlÖÐÔªËØÖµ¼ÓÈëcurrentValue
public void characters(char[] ch, int start, int length)
throws SAXException {
currentValue.append(ch, start, length);
}
//ÔÚÓöµ½</xx>ʱ£¬½«Ö®¼äµÄ×Ö·û´æ·ÅÔÚpropsÖмä
public void endElement(String uri, String localName, String name)
throws SAXException {
props.put(currentName.toLowerCase(), currentValue.toString().trim());
}
//¶¨Ò忪ʼ½âÎöÔªËصķ½·¨£¬ÕâÀォ<xx>ÖеÄÃû³ÆxxÌá³öÀ´£¬
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
currentValue.delete(0, currentValue.length());
currentName=qName;
}
//
}
3.XMLÅäÖÃÎļþ¼ÆÈ¡´¦Àí
package com;
/*
* XMLÅäÖÃÎļþ¼ÆÈ¡´¦Àí
*/
import java.util.Properties;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
public class ParseXML {
//¶¨ÒåÒ»¸öProertiesÓÃÀ´´æ·ÅÊôÐÔÖµ
private Properties props;
public Prope
Ïà¹ØÎĵµ£º
ż¶ûÔÚÍøÉÏ·¢ÏÖµÄһƬ¹ØÓÚÕÆÎÕJAVAµÄ±ê×¼£¬¸Ð¾õÓеãÒâ˼£¬ËäÈ»ÔÚһЩ¹ÛµãÉÏÓÐЩƫÆÄ£¬µ«×÷ΪѧϰJAVAµÄÒýµ¼Éпɡ£ÖÁÓÚÔ´´ÊÇËûÓбØÒª¿¼Ö¤¡£
ʱ³£¿´µ½Ò»Ð©ÈË˵ÕÆÎÕÁËJava£¬µ«ÊÇÈÃËûÃÇÓÃJava×öÒ»¸öʵ¼ÊµÄÏîÄ¿¿ÉÄÜÓÖÀ§ÄÑÖØÖØ£¬ÔÚÕâÀ±ÊÕ߸ù¾Ý×Ô¼ºµÄÒ»µãÀí½â¶·µ¨Ìá³ö×Ô¼ºµÄһЩ¶ÔÕÆÎÕJavaÕâ¸ö˵·¨µÄ±ê×¼£¬µ±È»¶ÔÓÚР......
Ị̈߳¨Thread£©·½Ã棺
1¡¢javaÖÐÓм¸ÖÖ·½·¨¿ÉÒÔʵÏÖÒ»¸öỊ̈߳¿ÓÃʲô¹Ø¼ü×ÖÐÞÊÎͬ²½·½·¨? stop()ºÍsuspend()·½·¨ÎªºÎ²»ÍƼöʹÓã¿
´ð£ºÓÐÁ½ÖÖʵÏÖ·½·¨£¬·Ö±ðÊǼ̳ÐThreadÀàÓëʵÏÖRunnable½Ó¿Ú
ÓÃsynchronized¹Ø¼ü×ÖÐÞÊÎͬ²½·½·¨
·´¶ÔʹÓÃstop()£¬ÊÇÒòΪËü²»°²È«¡£Ëü»á½â³ýÓÉÏ̻߳ñÈ¡µÄËùÓÐËø¶¨£¬ ......
JAVA annotationÈëÃÅ
×î½ü¶ÔspringÔ´Âë¸ÐÐËȤ£¬½ñÌì¿´µ½annotation²¿·Ö£¬ÂÔ¼ÇÖ®¡£
Ò». ×î³£¼ûµÄannotation
@Override:ÓÃÔÚ·½·¨Ö®ÉÏ£¬ÓÃÀ´¸æËß±ðÈËÕâÒ»¸ö·½·¨ÊǸÄд¸¸ÀàµÄ
@Deprecated:½¨Òé±ðÈ˲»ÒªÊ¹ÓþɵÄAPIµÄʱºòÓõÄ,±àÒëµÄʱºò»áÓòúÉú¾¯¸æÐÅÏ¢,¿ÉÒÔÉ趨ÔÚ ......
תÔØ×Ô http://littlefermat.blog.163.com/blog/static/59771167200962810120843/
Enum×÷ΪSunÈ«ÐÂÒý½øµÄÒ»¸ö¹Ø¼ü×Ö£¬¿´ÆðÀ´ºÜÏóÊÇÌØÊâµÄclass, ËüÒ²¿ÉÒÔÓÐ×Ô¼ºµÄ±äÁ¿£¬¿ÉÒÔ¶¨Òå×Ô¼ºµÄ·½·¨£¬¿ÉÒÔʵÏÖÒ»¸ö»òÕ߶à¸ö½Ó¿Ú¡£µ±ÎÒÃÇÔÚÉùÃ÷Ò»¸öenumÀàÐÍʱ£¬ÎÒÃÇÓ¦¸Ã×¢Òâµ½enumÀàÐÍÓÐÈçϵÄһЩÌØÕ÷¡£
1£®Ëü²»ÄÜÓÐpublicµÄ¹¹Ôìº¯Ê ......
Berkely DB¶ÔÓڸ߲¢·¢¡¢ÒªÇóËٶȿìµÄÓ¦ÓÃÀ´ËµÊǸö²»´íµÄÑ¡Ôñ£¬mysql¾ÍÊÇÓÃBDBʵÏÖµÄ(mysqlµÄºǫ́) £¬mysql¿ì£¬BDB±Èmysql»¹Òª¿ìN±¶¡£BDBÊÇÒ»ÖÖǶÈëʽµÄ¡¢·Ç¹ØϵÊý¾Ý¿â£¬ËüÓëÆäËûµÄ¹ØϵÊý¾Ý¿âRMDBS²»Í¬,ËüûÓÐÌṩSQL,¶øÊÇÌṩÁË×Ô¼ºµÄ·ÃÎʽӿڡ£×÷ΪһÖÖǶÈëʽµÄÊý¾Ý¿â£¬ËüÊǽø³ÌÄÚģʽµÄ£¬Ò²¾ÍÊÇ˵ËüºÍÓ¦ÓóÌÐòÔÚͬһÄÚ´æ¿ ......