JMS¸ÅÒª(Java Message Service Overview)
Õâ¸ö¹ØÓÚJMS(Java Message Service)µÄ¸ÅÒª»Ø´ðÁËÏÂÃ漸¸öÎÊÌ⣺
1.ʲôÊÇÏûÏ¢£¿
2.ôÊÇJMS API£¿
3.ÈçºÎʹÓÃJMS API£¿
4. JMS APIÊÇÈçºÎÓëJ2EEƽ̨һÆð¹¤×÷µÄ£¿
1.1ʲôÊÇÏûÏ¢£¿
ÏûÏ¢ÊÇÈí¼þ×é¼þ»òÕßÓ¦ÓÃÖ®¼ä½»Á÷µÄÒ»ÖÖ·½·¨¡£ÏûϢϵͳÊÇÒ»¸öµã¶ÔµãµÄ¹¦ÄÜ£¬Ò»¸öÏûÏ¢¿Í»§¶Ë¿ÉÒÔ·¢ËͺͽÓÊÜ´Ó±ðµÄ¿Í»§¶Ë·¢¹ýÀ´µÄÏûÏ¢£¬ÕâЩ¿Í»§¶ËÁ¬½Óµ½Ò»¸öÏûÏ¢´úÀí£¬Õâ¸ö´úÀíÌṩ´´½¨¡¢·¢ËÍ¡¢½ÓÊܺͶÁÈ¡ÏûÏ¢¡£
ÏûÏ¢È÷ֲ¼Ê½Í¨Ñ¶±äµÃËÉÉ¢ñîºÏ¡£Ò»¸ö×é¼þ·¢ËÍÒ»¸öÏûÏ¢µ½Ä¿µÄ¶Ë£¬½ÓÊÜ×Å¿ÉÒÔ´ÓÄ¿µÄµØ²éѯÏûÏ¢¡£µ«ÊÇ£¬·¢ËÍÕߺͽÓÊÜ×Ų»ÓÃͬʱÔÚÏß¡£Êµ¼ÊÉÏ£¬·¢ËÍÕßûÓбØÒªÖªµÀ¹ØÓÚ½ÓÊÜ×ŵÄÈκÎÐÅÏ¢£¬½ÓÊÜ×ÅÒ²²»ÐèÒª¡£·¢ËÍÕߺͽÓÊÜÕßÖ»ÐèÒªÖªµÀÏûÏ¢µÄ¸ñʽºÍÄ¿µÄµØ¡£´ÓÕâ¸ö·½ÃæÀ´¿´£¬ÏûÏ¢ºÍһЩ½ôÃÜñîºÏµÄ¼¼Êõ±ÈÈçRMIÓÐÇø±ð£¬RMIÐèÒªÖªµÀÔ¶³ÌÓ¦Óõķ½·¨¡£
ÏûÏ¢Ò²ÓÐÇø±ðÓÚEmail£¬EmailÊÇÈ˺ÍÈË£¬Èí¼þºÍÈ˽»Á÷µÄÊֶΡ£¶øÏûÏ¢ÊÇÈí¼þÓ¦ÓûòÕß×é¼þÖ®¼ä½»Á÷µÄÊֶΡ£
1.2 ʲôÊÇJMS API£¿
JMS APIÊÇÒ»¸öJava API£¬ËüÔÊÐíÓ¦Óô´½¨¡¢·¢ËÍ¡¢½ÓÊܺͶÁÈ¡ÏûÏ¢¡£JMS APIÊÇSunºÍÆäËû¼¸¸ö¹«Ë¾ºÏ×÷±àдµÄ£¬ÌṩÓÐһϵÁеĽӿںÍÓïÒ壬ÔÊÐíJavaÓïÑÔºÍÆäËûÏûϢʵÏÖͨÐÅ¡£
JMS×îС»¯ÁË¿ª·¢ÈËÔ±ÐèҪѧϰÏûϢϵͳÐèҪʹÓõĸÅÄ¶øÇÒÌṩÁË×ã¹»µÄ¹¦ÄÜÀ´Ö§³Ö¸´ÔÓµÄÏûÏ¢Ó¦Ó᣶øÇÒ×î´ó»¯ÁËJMSµÄ¿ÉÒÆÖ²ÐÔ¡£
JMS²»½ö½ö½µµÍÁËͨÐŵÄñîºÏ£¬¶øÇÒÓÐÒÔÏÂÌØÐÔ£º
· Òì²½µÄ
JMSÌṩÕß¿ÉÒÔ°ÑÏûÏ¢´«µÝ¸ø¿Í»§¶Ë£¬¿Í»§¶Ë²»ÓÃÈ¥Ö÷¶¯ÇëÇó
·¿É¿¿µÄ
JMS API¿ÉÒÔ±£Ö¤ÏûÏ¢»á±»´«µÝ¶øÇÒÖ»´«µÝÒ»´Î¡£Ó¦ÓÿÉÒÔ´¦Àí¶ªÊ§ÏûÏ¢ºÍ½ÓÊܵ½Öظ´ÏûÏ¢µÄÇé¿ö
JMS˵Ã÷ÔÚ1998ÄêµÚÒ»´Î³ö°æ£¬×îаæÊÇ1.0.2b£¬ÊÇ2001Äê·¢Ðеġ£
1.3ʲôʱºò¿ÉÒÔʹÓÃJMS
ÆóÒµÓ¦ÓÃÌṩÉÌÇ÷ÏòÓÚÑ¡ÔñJMS APIÀ´Ìæ´ú½ôÃÜñîºÏµÄ¼¼Êõ±ÈÈçRPC£¬»ùÓÚÏÂÃæµÄÔÒò£º
·ÌṩÉ̲»ÏëÈÃ×é¼þÒÀÀµÆäËû×é¼þ£¬ÕâÑù×é¼þ¿ÉÒÔÇáËÉÌæ»»
·ÌṩÉÌÏëÈÃÓ¦ÓÃÔËÐÐÔÚ²»¹ÜÆäËû×é¼þÊDz»ÊÇ¿ÉÓõÄÇé¿öÏÂ
·Ó¦ÓõÄÒµÎñÄ£ÐÍÔÊÐí×é¼þ·¢ËÍÐÅÏ¢µ½ÆäËû×é¼þ£¬¶ø²»ÐèҪʵʱµÄÏìÓ¦±ÈÈ磬һ¸öÆû³µÖÆÔìÉ̵ÄÆóÒµÓ¦ÓõÄ×é¼þ¿ÉÒÔÔÚÏÂÃæµÄÇé¿öÏÂʹÓÃJMS
·µ±´æ»õ²»×ãµÄʱºò£¬´æ»õ×é¼þ¿ÉÒÔ·¢ËÍÒ»¸öÏûÏ¢µ½¹¤³§×é¼þ£¬ÕâÑù¹¤³§¾Í¿ÉÒÔ¿ªÊ¼Éú²ú
·¹¤³§×é¼þ¿ÉÒÔ·¢ËÍÏûÏ¢µ½Áã¼þ×é¼þ£¬ÕâÑùÁã¼þ×é¼þ¾Í¿ÉÒԻ㼯ËûÐèÒªµÄÁã¼þ
·¹¤³§×é¼þºÍÁã¼þ×é¼þ¶¼¿ÉÒÔ·¢ËÍÏûÏ¢µ½»á¼Æ×é¼þÀ´¸üÐÂÔ¤ËãÊý
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
Java ¶ÁÈ¡ MySQL ÖÐÎÄ ÂÒÂë
³¡¾°:Java,eclipse£¬¶ÁÈ¡MySQLÊý¾Ý¿â£¬MySQL±àÂëΪutf-8
ÎÊÌ⣺¶Á³öÀ´µÄÖÐÎÄÔÚeclipseµÄÊä³ö´°¿ÚÖÐÏÔʾΪÂÒÂë
´íÎóµÄд·¨
1
System.out.print(new String( rs.getString("bib_author").getBytes("utf-8"),"GBK" ));
2
System.out.print( ......
//´ò¿ª¹¤¾ßµÄ·¾¶¼°Ãû×Ö
String toolsPath = "D:/office/Office12/WINWORD.EXE";
//±»´ò¿ªÎļþµÄ·¾¶¼°Ãû×Ö
String fileName = " D:/test.doc";
try {
Process p = Runtime.getRuntime().exec(toolsPath+fileName);
} catch (IOException e) {
// T ......
JAVAÀïµÄPINGÊÇÔÚJDK 1.5ºóÓÃÁËеĺ¯ÊýisreachableȥʵÏÖ,¾ßÌå½éÉÜÈçÏÂ:
InetAddress¶ÔÏóµÄ³£Ó÷½·¨
InetAddressÀàÓкܶàget·½·¨£¬ÓÃÀ´»ñÈ¡Ö÷»úÃû£¬Ö÷»úµØÖ·µÈÐÅÏ¢¡£Ö÷ÒªÓУº
byte[] getAddress() ·µ»Ø´ÎInetAddress¶ÔÏóµÄÔʼIPµØÖ·£¬±£´æΪһ¸öbyteÊý×é
String getCanonicalHostName() »ñÈ¡´ËIPµØÖ·µÄÍêÈ«ÏÞ¶ ......