JAVA»ù´¡££JAVAÖеķ´Éä»úÖÆÏê½â
תÌù£ºhttp://java.ccidnet.com/art/3539/20070924/1222147_1.html
JAVA·´Éä»úÖÆ
JAVA·´Éä»úÖÆÊÇÔÚÔËÐÐ״̬ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬¶¼Äܹ»ÖªµÀÕâ¸öÀàµÄËùÓÐÊôÐԺͷ½·¨£»¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏ󣬶¼Äܹ»µ÷ÓÃËüµÄÈÎÒâÒ»¸ö·½·¨£»ÕâÖÖ¶¯Ì¬»ñÈ¡µÄÐÅÏ¢ÒÔ¼°¶¯Ì¬µ÷ÓöÔÏóµÄ·½·¨µÄ¹¦ÄܳÆΪjavaÓïÑԵķ´Éä»úÖÆ¡£
Java·´Éä»úÖÆÖ÷ÒªÌṩÁËÒÔϹ¦ÄÜ£º ÔÚÔËÐÐʱÅжÏÈÎÒâÒ»¸ö¶ÔÏóËùÊôµÄÀࣻÔÚÔËÐÐʱ¹¹ÔìÈÎÒâÒ»¸öÀàµÄ¶ÔÏó£»ÔÚÔËÐÐʱÅжÏÈÎÒâÒ»¸öÀàËù¾ßÓеijÉÔ±±äÁ¿ºÍ·½·¨£»ÔÚÔËÐÐʱµ÷ÓÃÈÎÒâÒ»¸ö¶ÔÏóµÄ·½·¨£»Éú³É¶¯Ì¬´úÀí¡£
1. µÃµ½Ä³¸ö¶ÔÏóµÄÊôÐÔ
1 public Object getProperty(Object owner, String fieldName) throws Exception {
2 Class ownerClass = owner.getClass();
3
4 Field field = ownerClass.getField(fieldName);
5
6 Object property = field.get(owner);
7
8 return property;
9 }
Class ownerClass = owner.getClass()£ºµÃµ½¸Ã¶ÔÏóµÄClass¡£
Field field = ownerClass.getField(fieldName)£ºÍ¨¹ýClassµÃµ½ÀàÉùÃ÷µÄÊôÐÔ¡£
Object property = field.get(owner)£ºÍ¨¹ý¶ÔÏóµÃµ½¸ÃÊôÐÔµÄʵÀý£¬Èç¹ûÕâ¸öÊôÐÔÊǷǹ«Óеģ¬ÕâÀï»á±¨IllegalAccessException¡£
2. µÃµ½Ä³¸öÀàµÄ¾²Ì¬ÊôÐÔ
1 public Object getStaticProperty(String className, String fieldName)
2 throws Exception {
3 Class ownerClass = Class.forName(className);
4
5 Field field = ownerClass.getField(fieldName);
6
7 Object property = field.get(ownerClass);
8
9 return property;
10 }
Class ownerClass = Cla
Ïà¹ØÎĵµ£º
½ñÌìÓöµ½Ò»¸öºÜ¹îÒìµÄbug£¬µ÷ÊÔÁË°ëÌìҲûÓп´³öÀ´ÓÐʲôÎÊÌ⣬³éÏóһϴúÂëÈçÏ£º
public class Instance
{
public static Instance instance = new Instance();
public static Map<String, String> map = new HashMap<String, String>();
public static Instance instance()
{
r ......
×÷ÕߣºÐûÕ×Åô
------------------------------------------------------------------------------------------------------------------------------------------
¹¤×÷µÚÒ»²½£ºÊìϤMyEclipseµÄ»·¾³ÒÔ¼°Ö÷Òª¹¦ÄÜ¡£
¹¤×÷µÚ¶þ²½£º½¨Á¢Êý¾Ý¿âÁ¬½Ó
Êý¾Ý¿â£ºMySQL
1¡¢MySQLµÄÅäÖÃÓëÎÊÌâ½â¾ö
Ïê¼ûÎ ......
1. W3C°Ñ±êÇ©ÄÚµÄÎı¾²¿·ÖÒ²¶¨Òå³ÉÒ»¸öNode
2.
Element¶ÔÏó´ú±íµÄÊÇXMLÎĵµÖеıêÇ©ÔªËØ
£¬¼Ì³ÐÓÚNode£¬ÒàÊÇNodeµÄ×îÖ÷ÒªµÄ×Ó¶ÔÏó
3. Attrʵ¼ÊÉÏÊÇ°üº¬ÔÚElementÖеģ¬Ëü²¢²»Äܱ»¿´×÷ÊÇElementµÄ×Ó¶ÔÏó£¬Òò¶øÔÚDOMÖÐAttr²¢²»ÊÇDOMÊ÷µÄÒ»²¿·Ö£¬ËùÒÔNodeÖÐµÄ getparentNode()£¬getpreviousSiblin ......
²ÉÓô®¿Ú²Ù×÷½øÐжÌÐÅÊÕ·¢,ÊDZȽϳ£¼ûµÄÒ»ÖÖ·½Ê½.±ÈÈç,ºÜ¶àȺ·¢Èí¼þ,ÓõľÍÊÇÕâÖÖ·½·¨.
1.ÅäÖÃcomm.jar.
Comm.jarÊÇSubʵÏֵײ㴮¿Ú²Ù×÷µÄAPI,µ÷ÓÃÁ˱¾µØµÄDLLÎļþ,ÒòΪJava±¾Éí²»¾ß±¸Ö±½Ó·ÃÎÊÓ²¼þÉèÖõÄÄÜÁ¦,¶¼ÊÇͨ¹ýµ÷Óñ¾µØ·½·¨À´Êµ
ÏÖµÄ.¿ÉÒÔJavaµÄ¹Ù·½ÍøÕ¾ÏÂÔØ.ÏÂÔØÖ®ºó°ÑÆäÖÐComm.jar°üµ¼Èëµ½¹¤³ÌµÄClasspathÖÐ,°Ñ ......
create or replace procedure updateProject is
begin
update project p set p.total_intend_gather =
(select sum(ig.gather_sum) from intend_gather ig where ig.project_number=p.project_number);
up ......