Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA¶ÁÈ¡Íⲿ×ÊÔ´µÄ·½·¨

ÔÚjava´úÂëÖо­³£ÓжÁÈ¡Íⲿ×ÊÔ´µÄÒªÇó:ÈçÅäÖÃÎļþµÈµÈ,ͨ³£»á°ÑÅäÖÃÎļþ·ÅÔÚclasspathÏ»òÕßÔÚwebÏîÄ¿ÖзÅÔÚweb-infÏÂ.
1.´Óµ±Ç°µÄ¹¤×÷Ŀ¼ÖжÁÈ¡:
        try {
            BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream("wkdir.txt")));
            String str;
            while ((str = in.readLine()) != null) {
                System.out.println(str);
            }
            in.close();
        } catch (IOException e) {
        }
2,´ÓclasspathÖжÁÈ¡(¶ÁÈ¡ÕÒµ½µÄµÚÒ»¸ö·ûºÏÃû³ÆµÄÎļþ):
        try {
            InputStream stream = ClassLoader.getSystemResourceAsStream("fileinjar.txt");
            BufferedReader in = new BufferedReader(new InputStreamReader(stream));
            String str;
            while ((str = in.readLine()) != null) {
                System.out.println(str);
            }
            in.close();
        } catch (IOException e) {
        }
3,´ÓclasspathÖжÁÈ¡(¶ÁÈ¡ÕÒµ½µÄËùÓзûºÏÃû³ÆµÄÎļþ,ÈçSpringÖдøÓÐclasspath*:ǰ׺µÄÇé¿ö¾Í»á´ÓclasspathÖбéÀú):
        try {
            Enumeration resourceUrls = Thread.currentThread().get


Ïà¹ØÎĵµ£º

JavaÖи÷ÀàCache»úÖÆʵÏÖ½â¾ö·½°¸

ÔÚJavaÖУ¬²»Í¬µÄÀ඼ÓÐ×Ô¼ºµ¥¶ÀµÄCache»úÖÆ£¬ÊµÏֵķ½·¨Ò²¿ÉÄÜÓÐËù²»Í¬£¬ÎÄÕÂÁоÙÁËJavaÖг£¼ûµÄ¸÷ÀàCache»úÖƵÄʵÏÖ·½·¨£¬Í¬Ê±½øÐÐÁË×ۺϵıȽϡ£
OSCache
OSCacheÊǸöÒ»¸ö¹ã·º²ÉÓõĸßÐÔÄܵÄJava EE»º´æ¿ò¼Ü£¬OSCacheÄÜÓÃÓÚÈκÎJavaÓ¦ÓóÌÐòµÄÆÕͨµÄ»º´æ½â¾ö·½°¸¡£
OSCacheÓÐÒÔÏÂÌص㣺»º´æÈκζÔÏó£¬Äã¿ÉÒÔ²»ÊÜÏÞÖƵ ......

java¿ª·¢ÖÐMysqlÖÐÎÄÂÒÂëÎÊÌâµÄ½â¾ö

     MysqlÔÚĬÈÏÇé¿öϽ¨Á¢±íµÄ×Ö·û±àÂëÊÇlatin1£¬ËùÒÔÔÚ²åÈëÖÐÎÄʱ»á³ö´í¡£
eg£º
1¡¢²é¿´±í½¨Á¢µÄsqlÔ´Â룺
1: sqlÃüÁshow create table users
2:
3: ½á¹û£º
4: CREATE TABLE `users` (
5: `userID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6: `userName` varchar(4 ......

JavaÅäÖÃÎļþ¶ÁÈ¡

JavaÅäÖÃÎļþ¶ÁÈ¡Óи÷ÖÖ²»Í¬µÄÎļþ£¬µ«ÊÇÓÉÓÚ´ò°üJarºóµÄ·¾¶¸Ä±ä£¬ÍùÍùÔÚÏîÄ¿ÖÐÄÜÕýÈ·¶ÁÈ¡µÄÅäÖÃÎļþÔÚJarºó±ä³ÉÎļþ²»´æÔڵı­¾ß£¬ÏÂÔÚÌá³ö¼¸¸÷²»Í¬µÄÅäÖÃÎļþ¶ÁÈ¡·½Ê½£¬½ö¹©²Î¿¼
Ò»¡¢Ö±½ÓÎļþ¶ÁÈ¡
File f = new File("you config file path");
FileReader fr = new FileReader(f);
BufferReader br = new ......

java¶ÁÈ¡propertiesÊôÐÔÎļþÖµ·½·¨

ÔÚʹÓÃhibernate»òÕßspringµÄʱºò£¬ÎÒÃÇÍùÍùͨ¹ýÅäÖÃÎļþÅäÖÃÊý¾Ý¿âÁ¬½ÓÊôÐÔ¡£µ«Õâ´ÎÏîÄ¿Öв¢Ã»ÓÐÓõ½hibernateºÍspring£¬Ö»Óõ½ÁËstruts2¡£ÒªÈçºÎʵÏÖͨ¹ý¶ÁÈ¡ÎļþÅäÖûñÈ¡ÊôÐÔÖµÄØ£¿ResourceBundleÕâ¸öÀà¿ÉÊÇʵÏÖ¶ÁÈ¡propertiesÎļþÀ´»ñÈ¡Öµ
ÔÚjavaÖУº
public final static Object initLock = new Object();
privat ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ