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

📄 admintest.java~1~

📁 一个很不错的电子商务后台管理系统 这是一个电子商务网站的后台管理系统 要运行此系统必须具备以下条件 1.首先要把SNSQL文本中的SQL脚本确保在SQL Server中执行 2.包Se
💻 JAVA~1~
字号:
package xian.bin.admin;import javax.naming.*;import java.util.Properties;import javax.rmi.PortableRemoteObject;public class AdminTest extends Object {  private AdminHome adminHome = null;  //Construct the EJB test client  public AdminTest() {    initialize();  }  public void initialize() {    try {      //get naming context      Context context = getInitialContext();      //look up jndi name      Object ref = context.lookup("Admin");      //look up jndi name and cast to Home interface      adminHome = (AdminHome) PortableRemoteObject.narrow(ref, AdminHome.class);    }    catch(Exception e) {      e.printStackTrace();    }  }  private Context getInitialContext() throws Exception {    String url = "t3://815-L2dboss:7001";    String user = null;    String password = null;    Properties properties = null;    try {      properties = new Properties();      properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");      properties.put(Context.PROVIDER_URL, url);      if (user != null) {        properties.put(Context.SECURITY_PRINCIPAL, user);        properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);      }      return new InitialContext(properties);    }    catch(Exception e) {      System.out.println("Unable to connect to WebLogic server at " + url);      System.out.println("Please make sure that the server is running.");      throw e;    }  }  //----------------------------------------------------------------------------  // Utility Methods  //----------------------------------------------------------------------------  public AdminHome getHome() {    return adminHome;  }  //Main method  public static void main(String[] args) throws Exception{    AdminTest client = new AdminTest();  }}

⌨️ 快捷键说明

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