新手提问:lookup和forname有什么不同?
我的code如下:
InitialContext initialContext = new InitialContext();
Object obj = initialContext.lookup("ejb/library/StudentTransSession");
StudentTransSessionHome studentTransSessionHome = (StudentTransSessionHome)
javax.rmi.PortableRemoteObject.narrow(obj,StudentTransSessionHome.class);
这里我想用forName来拿到StudentTransSeesionHome,为什么编译的时候无法通过呢?说无法转换。
StudentTransSessionHome studentTransSessionHome = (StudentTransSessionHome)Class.forName("library.StudentTransSessionHome");
InitialContext initialContext = new InitialContext();
Object obj = initialContext.lookup("ejb/library/StudentTransSession");
StudentTransSessionHome studentTransSessionHome = (StudentTransSessionHome)
javax.rmi.PortableRemoteObject.narrow(obj,StudentTransSessionHome.class);
这里我想用forName来拿到StudentTransSeesionHome,为什么编译的时候无法通过呢?说无法转换。
StudentTransSessionHome studentTransSessionHome = (StudentTransSessionHome)Class.forName("library.StudentTransSessionHome");
...全文
相关推荐
Lookup Table导入表格
在 Lookup Table 中,数据可以来自多种来源,包括 TXT 文件和 EXCEL 表格。下面将分别介绍如何将这两种类型的文件导入到 Lookup Table 中。
Linux编程中的自定义消息队列
在Linux编程中,我们可以使用系统提供的消息队列,也可以自定义消息队列来满足特定的需求。通过自定义消息队列,我们可以实现进程间的数据传递和通信,从而满足特定的需求。函数创建消息队列,并指定了创建方式为IPC_CREAT | 0666,表示创建一个新的消息队列或获取一个已经存在的消息队列。函数从消息队列中接收消息,消息的类型为0,表示接收任意类型的消息。函数生成一个唯一的key,该key将作为消息队列的标识符。函数发送了一条消息到消息队列中,消息的类型为1。接下来,我们使用生成的key来创建消息队列。
lookup函数的使用
"Excel Lookup 函数的使用和经典查找方式" Lookup 函数是 Excel 中最常用的查找函数之一,它可以帮助用户快速地查找和匹配数据。
解析SQL Server聚焦移除(Bookmark Lookup、RID Lookup、Key Lookup)
首先,理解这三种查找的区别:1. **Bookmark Lookup**:在SQL Server 2005之前的版本中称为Key Lookup。
2017 Revit Lookup
无论是新手还是经验丰富的Revit用户,都能够从Revit Lookup中获益,提升他们的设计和协作体验。


