Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 求助:关于jboss查找实体bean的问题
tozx96





发贴: 26
积分: 0
于 2003-07-13 18:57 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我写了两个cmp1.1,名称分别是TestPerson和EstItem,然后我写了一个sessionbean,名成为EnterpriseBean1,我的目的就是在EnterpriseBean1查找相应的实体bean,代码如下:
Collection estItemCol = estItemHome.findSystemItem();
System.out.println(estItemCol.size() );
Iterator iteEstItem = estItemCol.iterator() ;
while(iteEstItem.hasNext() ){
Object obj = iteEstItem.next() ;
EstItem estItem = (EstItem)PortableRemoteObject.narrow(obj,EstItem.class);
System.out.println(estItem.getItemName() );
}

Collection testPersonCol = testPersonHome.findByIdAndName("200307000001","a");
System.out.println(testPersonCol.size() );
Iterator ite = testPersonCol.iterator() ;
while(ite.hasNext() ){
Object obj = ite.next() ;
TestPerson testPerson = (TestPerson)PortableRemoteObject.narrow(obj,TestPerson.class);
System.out.println(testPerson.getPersonName());
}
这段代码的目的就是输出两个实体bean的fander方法的结果,但是执行到estItem.getItemName() 出下了如下异常:
18:34:49,853 ERROR [JDBCCommand] Exception caught executing SQL
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver]ResultSet can not re-re
ad row data for column 1.(后面还有很长的异常信息,但可能没用,所以就写出来)
更奇怪的是testPerson.getPersonName()又不会出现这个异常。
请各位高手指点。非常谢谢。




话题树型展开
人气 标题 作者 字数 发贴时间
3736 求助:关于jboss查找实体bean的问题 tozx96 1242 2003-07-13 18:57
3093 Re:求助:关于jboss查找实体bean的问题 why 289 2003-07-13 19:29
3201 Re:求助:关于jboss查找实体bean的问题 tozx96 38 2003-07-13 19:53
3202 Re:求助:关于jboss查找实体bean的问题 tozx96 49 2003-07-13 20:22
3066 Re:求助:关于jboss查找实体bean的问题 why 271 2003-07-13 20:37
3316 Re:求助:关于jboss查找实体bean的问题 tozx96 5 2003-07-13 21:48

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923