untitled1.java

来自「本书中的源代码是以JBuilder工程形式组织的」· Java 代码 · 共 20 行

JAVA
20
字号
package myjms;import java.util.*;import javax.naming.*;public class Untitled1 {  public static void main(String[] args) {    Jms1 myQueue=new Jms1();    Hashtable ht = new Hashtable();    ht.put(Context.INITIAL_CONTEXT_FACTORY,            "weblogic.jndi.WLInitialContextFactory");    ht.put(Context.PROVIDER_URL, "t3://localhost:7001");    myQueue.setEnvironment(ht);    String message = "hello,jms";    try{     myQueue.sendText(message);     myQueue.close();     System.out.println("the message has been sended");     }catch (Exception e){e.printStackTrace();}   }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?