JAVA¶ÁÈ¡PropertiesÎļþµÄÁùÖÖ·½·¨
ʹÓÃJ2SEAPI¶ÁÈ¡PropertiesÎļþµÄÁùÖÖ·½·¨
¡¡¡¡1¡£Ê¹ÓÃjava.util.PropertiesÀàµÄload()·½·¨Ê¾Àý£ºInputStream in=lnew BufferedInputStream(new FileInputStream(name));
properties p=newProperties(); p.load(in);
¡¡¡¡2¡£Ê¹ÓÃjava.util.ResourceBundleÀàµÄgetBundle()·½·¨Ê¾Àý£ºResourceBundle rb=ResourceBundle.getBundle
(name,Locale.getDefault());
¡¡¡¡3¡£Ê¹ÓÃjava.util.PropertyResourceBundleÀàµÄ¹¹Ô캯ÊýʾÀý£ºInputStream in=new BufferedInputStream(new FileInputStream
(name));ResourceBundle rb=newPropertyResourceBundle(in);
¡¡¡¡4¡£Ê¹ÓÃclass±äÁ¿µÄgetResourceAsStream()·½·¨Ê¾Àý£ºInputStream in=JProperties.class.getResourceAsStream(name);
properties p=newProperties(); p.load(in);
¡¡¡¡5¡£Ê¹ÓÃclass.getClassLoader()ËùµÃµ½µÄjava.lang.ClassLoaderµÄgetResourceAsStream()·½·¨Ê¾Àý£ºInputStream
in=JProperties.class.getClassLoader().getResourceAsStream(name); properties p=newProperties(); p.load(in);
¡¡¡¡6¡£Ê¹ÓÃjava.lang.ClassLoaderÀàµÄgetSystemResourceAsStream()¾²Ì¬·½·¨Ê¾Àý£ºInputStream
in=ClassLoader.getSystemResourceAsStream(name); properties p=newProperties(); p.load(in);
¡¡¡¡²¹³ä
¡¡¡¡ServletÖпÉÒÔʹÓÃjavax.servlet.ServletContextµÄgetResourceAsStream()·½·¨Ê¾Àý£ºInputStream
in=context.getResourceAsStream(path); properties p=newProperties(); p.load(in);
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔǰ£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
Reflection ÊÇJava±»ÊÓΪ¶¯Ì¬£¨»ò×¼¶¯Ì¬£©ÓïÑÔµÄÒ»¸ö¹Ø¼üÐÔÖÊ¡£Õâ¸ö»úÖÆÔÊÐí³ÌÐòÔÚÔËÐÐʱ͸¹ýReflection APIsÈ¡µÃÈκÎÒ»¸öÒÑÖªÃû³ÆµÄclass
µÄÄÚ²¿ÐÅÏ¢£¬°üÀ¨Æämodifiers£¨ÖîÈçpublic, static µÈµÈ£©¡¢superclass£¨ÀýÈçObject£©¡¢ÊµÏÖÖ®interfaces£¨ÀýÈçCloneable£©£¬Ò²°üÀ¨fields
ºÍmethodsµÄËùÓÐÐÅÏ ......
½ñÌìÔÙÂÛ̳¿´µ½ÁËÓÐÈËÎÊJAVAÃüÃû¹æ·¶£¬ÎÒ¾õµÃÕâ¸öÎÊÌâµÄÈ·ÐèÒª×¢ÖØÒ»ÏÂ
ÒòΪ¶ÔÓÚÒ»¸ö³ÌÐòÀ´Ëµ ³ÌÐòµÄ¸ñʽÊǷdz£ÖØÒª£¬Ãû×ÖÆð³ÉʲôÑù¿ÉÒÔ¿´³öÕâ¸öÈ˵ıà³ÌÄÜÁ¦£¬
Èç¹ûÒ»¸öÈ˵ijÌÐòдµÄ·Ç³£µÄÂÒ£¬Ãû×Öûһµã¹æ·¶µÄ»°»á¾õµÃ³ÌÐòºÜ"³ó"£¬Õâ»áÈöÁÕ߸ù±¾Ã»
ÐÄ˼ÍùÏ¿´
ÏÂÃæÕª×ÔÂÛÌ³Ò»ÍøÓѶÔÃüÃû¹æ·¶µÄ×ܽ᣺
1.°ü
ÓÉСР......
//»ñÈ¡Êý¾Ý¿âÊý¾Ý·µ»Ølist
public List queryAll(int fcateId) {
List list = new ArrayList();
String sql = "select * from g_Account where fCateID=? order by fCode";
Connection con = SqlHelp.getConn();//»ñµÃÁ¬½Ó£¬sqlhelp×Ô¼ºÐ´µÄ¹¤¾ßÀà
PreparedStatement pst = null;
ResultSet rs = null;
......