Berkely DB Java Editionѧϰ±Ê¼Ç
Berkely DB¶ÔÓڸ߲¢·¢¡¢ÒªÇóËٶȿìµÄÓ¦ÓÃÀ´ËµÊǸö²»´íµÄÑ¡Ôñ£¬mysql¾ÍÊÇÓÃBDBʵÏÖµÄ(mysqlµÄºǫ́) £¬mysql¿ì£¬BDB±Èmysql»¹Òª¿ìN±¶¡£BDBÊÇÒ»ÖÖǶÈëʽµÄ¡¢·Ç¹ØϵÊý¾Ý¿â£¬ËüÓëÆäËûµÄ¹ØϵÊý¾Ý¿âRMDBS²»Í¬,ËüûÓÐÌṩSQL,¶øÊÇÌṩÁË×Ô¼ºµÄ·ÃÎʽӿڡ£×÷ΪһÖÖǶÈëʽµÄÊý¾Ý¿â£¬ËüÊǽø³ÌÄÚģʽµÄ£¬Ò²¾ÍÊÇ˵ËüºÍÓ¦ÓóÌÐòÔÚͬһÄÚ´æ¿Õ¼äÔËÐУ¬ËùÒÔËÙ¶ÈÒª¸ßºÜ¶à£¬ÓëǶÈëʽµÄÊý¾Ý¿âÈçDerby¡¢HSQLDB(¶¼ÊÇRMDBSµÄ)Ïà±È£¬ËüЧÂʸü¸ß£¬Ê¹Ó÷½·¨Ò²ÓкܴóµÄ²»Í¬¡£ÏÖÔÚBDBÒÔ±»OracleÊÕ¹º¡£Berkely DBÌṩµÄÎĵµGetting Started with¡¡Berkeley DB Java Edition¿ÉÒÔ˵ÊǶÌС¾«º·£¨£±£±£³Ò³£©£¬ÈëÃÅÏ൱²»´í¡£ÏÂÃæGet Start°É£º
Environment£º
Ê×ÏÈÒª½Ó´¥µÄ¾ÍÊÇEnvironmentÁË£¬Ê¹ÓÃËüÀ´open¡¡databaseÒÔ¼°×öÒ»¹ÜÀí·½ÃæµÄÊÂÇé.
´´½¨Environment£¬»¹ÐèÒªEnvironmentµÄһЩÅäÖÃÐÅÏ¢EnvironmentConfig¡£
ÏÂÃæÊÇ´´½¨µÄ¹ý³Ì£º
Java´úÂë :
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
myDbEnvironment = new Environment(new File("/export/dbEnv"),
envConfig);
ÆäÖÐEnvironmentConfigÌṩÁËÐí¶àÅäÖòÎÊý£¬³£ÓõÄÓУº
envConfig.setAllowCreate()//Èç¹û²»´æÔÚµÄenvµÄ»°£¬ÊÇ·ñÒª´´½¨Ò»¸öеÄ
envConfig.setReadOnly()//ÊÇ·ñΪֻ¶ÁµÄ
envConfig.setTransactional()//ÊÇ·ñʹÓÃÊÂÎñ
²ÎÊý¶¼ÊÇbooleanÀàÐ͵Ä
³ýÁËEnvironmentConfigÍ⣬»¹ÓÐEnvironmentMutableConfig£¬Ëûʵ¼ÊÊÇEnvironmentConfigµÄ¸¸À࣬ʹÓÃËûÀ´ÅäÖÃÔÚ´´½¨ÍêEnvironmentÖ®ºó¿ÉÒԸıä
µÄÊôÐÔ£º
setCachePercent()//ÉèÖÃcacheµÄ´óСռJVM¡¡memoryµÄ°Ù·Ö±È
setCacheSize()//ÉèÖÃcacheµÄ´óС
setTxnNoSync()//ÊÂÎñÌá½»ÊÇ·ñ½«¸Ä±äµÄ¼Ç¼дÈë´ÅÅÌ
setTxnWriteNoSync()//ÊÂÎñÌá½»ÊÇ·ñ½«logдÈë´ÅÅÌ
ÏÂÃæ¿´Ò»ÏÂʹÓÃEnvironmentMutableConfigµÄ·½·¨:
Environment myEnv = new Environment(new File("/export/dbEnv"), null);
EnvironmentMutableConfig envMutableConfig =
new EnvironmentMutableConfig();
envMutableConfig.setTxnNoSync(true);
myEnv.setMutableConfig(envMutableConfig);
Environmentͨ¹ýcloseÀ´¹Ø±Õ£¬ÊÍ·Å×ÊÔ´
ÏÂÃæ¿´¿´EnvironmentÔÚ¹ÜÀí·½ÃæµÄһЩ·½·¨£º
¿ÉÒÔͨ¹ýEnvironment»ñµÃEnvironmentStats£¬ËûÌṩÁËEnvironmentһЩ״̬ÐÅÏ¢£¬
ÀýÈçʹÓÃ
long cacheMisses = myEnv.get
Ïà¹ØÎĵµ£º
Éè¼ÆģʽÔÚÁ£¶ÈºÍ³éÏó²ã´ÎÉϸ÷²»Ïàͬ¡£ÓÉÓÚ´æÔÚÖÚ¶àµÄÉè¼Æģʽ£¬ËùÒÔÎÒÃÇ¿ÉÒÔÓÃÒ»ÖÖ·½Ê½½«ËüÃÇ×éÖ¯ÆðÀ´¡£ÕâÀÎÒÃǸù¾ÝÁ½Ìõ×¼Ôò¶Ôģʽ½øÐзÖÀ࣬ÈçϱíËùʾ£º
µÚÒ»ÊÇÄ¿µÄ×¼Ôò£¬¼´Ä£Ê½ÊÇÓÃÀ´Íê³Éʲô¹¤×÷µÄ¡£Ä£Ê½ÒÀ¾ÝÆäÄ¿µÄ¿É·ÖΪ´´½¨ÐÍ£¨ Creational£©¡¢½á¹¹ÐÍ( Structural)¡¢»òÐÐΪÐÍ( Behavioral )ÈýÖÖ¡£´´½¨ÐÍģʽÓë¶Ô ......
ż¶ûÔÚÍøÉÏ·¢ÏÖµÄһƬ¹ØÓÚÕÆÎÕJAVAµÄ±ê×¼£¬¸Ð¾õÓеãÒâ˼£¬ËäÈ»ÔÚһЩ¹ÛµãÉÏÓÐЩƫÆÄ£¬µ«×÷ΪѧϰJAVAµÄÒýµ¼Éпɡ£ÖÁÓÚÔ´´ÊÇËûÓбØÒª¿¼Ö¤¡£
ʱ³£¿´µ½Ò»Ð©ÈË˵ÕÆÎÕÁËJava£¬µ«ÊÇÈÃËûÃÇÓÃJava×öÒ»¸öʵ¼ÊµÄÏîÄ¿¿ÉÄÜÓÖÀ§ÄÑÖØÖØ£¬ÔÚÕâÀ±ÊÕ߸ù¾Ý×Ô¼ºµÄÒ»µãÀí½â¶·µ¨Ìá³ö×Ô¼ºµÄһЩ¶ÔÕÆÎÕJavaÕâ¸ö˵·¨µÄ±ê×¼£¬µ±È»¶ÔÓÚР......
תÔØ×Ô http://littlefermat.blog.163.com/blog/static/59771167200962810120843/
Enum×÷ΪSunÈ«ÐÂÒý½øµÄÒ»¸ö¹Ø¼ü×Ö£¬¿´ÆðÀ´ºÜÏóÊÇÌØÊâµÄclass, ËüÒ²¿ÉÒÔÓÐ×Ô¼ºµÄ±äÁ¿£¬¿ÉÒÔ¶¨Òå×Ô¼ºµÄ·½·¨£¬¿ÉÒÔʵÏÖÒ»¸ö»òÕ߶à¸ö½Ó¿Ú¡£µ±ÎÒÃÇÔÚÉùÃ÷Ò»¸öenumÀàÐÍʱ£¬ÎÒÃÇÓ¦¸Ã×¢Òâµ½enumÀàÐÍÓÐÈçϵÄһЩÌØÕ÷¡£
1£®Ëü²»ÄÜÓÐpublicµÄ¹¹Ôìº¯Ê ......
´úÂë¿é£º¾ÍÊÇÓÃ{}À¨ÆðÀ´µ½²¿·Ö¡£¸ù¾ÝÓ¦ÓõIJ»Í¬·ÖΪ4Àà:ÆÕͨ´úÂë¿é¡¢¹¹Ôì¿é¡¢¾²Ì¬´úÂë¿é¡¢Í¬²½´úÂë¿é¡£
1.ÆÕͨ´úÂë¿é£º¶¨ÒåÔÚ·½·¨ÖеĴúÂë¿é¡£
È磺
public class Ex22 {
public static void main(String[] args){
// ÆÕͨ´úÂë¿é
{
int i = 3;
System.out.println("¾Ö²¿±äÁ¿Îª " + i);
}
int i = 5 ......
½ñÌìÁìµ¼·Ô¸ÀÒ»¸öÈÎÎñ,¾ÍÊÇÓÃ.net¼¼ÊõÈ¥ÌøÓÃjava¶ËдµÄwebservers,¶øÇÒÒª²ÉÓÃhttps·ÃÎÊ·½Ê½,Ç¿ÖÆÂÛÖ¤
String SecurelyStoredPassword = "adminsd";
&nb ......