tozx96
发贴: 26
积分: 0
|
于 2003-07-13 18:57
我写了两个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()又不会出现这个异常。 请各位高手指点。非常谢谢。
|