ejbSelect()在实体Bean内部是一种辅助方法来访问数据库,并不在Home接口中或者组件接口中向用户公开,容器将会自动在ejbSelect()方法中生成代码。关于它的调用,他不能在远程接口和本地接口调用,但是可以在商务方法中调用,这才是它和ejbFind的区别,但它们是用同样的方式告诉容器是怎么编写的
解决方案 »
- 学java ee开发。
- 在hibernate中怎么样写这条sql语句
- java.lang.ClassCastException: java.lang.String cannot be cast to common.User
- 好漂亮的EOS代码
- websphere的welcome-file,设置成login.spr问题
- 高手速来,解决分多哦!!
- 网上.do转发变成本地的超链接产生问题(在线等)
- 如何能用java让针式打印机自动换页
- 关于 Tomcat:出现异常
- jbuilder中怎么使用JDOM呢 望高手指点 HELP
- JDBC连接数据库有问题~
- 怎样在Weblogic中设置JDBC啊?我要连接的是MS SQL SERVER,安装了SQL SERVER的驱动了,不行啊?急啊!
<query>
<query-method>
<method-name>ejbSelectxxx</method-name>
...
...
</query-method>然后在你的方法中,用Collection c = this.ejbSelectxxx();就可以得到select的结果如果你用工具生成代码的话,就想生成find方法一样,定义你的select方法,就可以了,用的时候方法是一样的
下面是我得在另一个方法中的调用:
public void selectID() throws Exception {
Collection c=this.ejbSelectid() ;
try{
Iterator i=c.iterator();
while(i.hasNext())
{System.out .println(i.toString() );
}
}
catch(Exception e){};
/**@todo Complete this method*/
}
"y2.jar": <2004-10-12 下午16时37分21秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: Student has a class y2.StudentBean that is in the classpath. This class should only be located in the ejb-jar file.>
"y2.jar": <2004-10-12 下午16时37分22秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: Student has a class y2.StudentRemoteHome that is in the classpath. This class should only be located in the ejb-jar file.>
"y2.jar": <2004-10-12 下午16时37分22秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: Student has a class y2.StudentRemote that is in the classpath. This class should only be located in the ejb-jar file.>
"y2.jar": <2004-10-12 下午16时37分22秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: Student has a class y2.StudentHome that is in the classpath. This class should only be located in the ejb-jar file.>
"y2.jar": <2004-10-12 下午16时37分22秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: Student has a class y2.Student that is in the classpath. This class should only be located in the ejb-jar file.>
"y2.jar": [J2EE:160121]Errors encountered while compiling module 'D:\javawork\y2\y2.jar.jar':
"y2.jar": In EJB Student, the throws clause for method selectID() in the bean class contains exceptions that are NOT in the throws clause of the remote interface.
请楼上的高手指点。