⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testclient.java

📁 Jboss s J2EE Sample
💻 JAVA
字号:
/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package test.client;

import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject; 

import test.interfaces.TestSession;
import test.interfaces.TestSessionHome;

public class TestClient {

   public static void main(String[] args){
      try {
         InitialContext lContext = new InitialContext();
         
         TestSessionHome lHome = (TestSessionHome) lContext.lookup( "ejb/test/TestSession" );
         TestSession lSession = lHome.create();
         // Get a new Id of the Test Entity
         int lId = lSession.getNewEntityId();
         System.out.println( "New Entity Id is: " + lId );
         
         lSession.remove();
      } catch( Exception e ){
         e.printStackTrace();
      }
   }

}

⌨️ 快捷键说明

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