当前位置: 技术问答>java相关
session bean调用entity bean的一个奇怪的问题!
来源: 互联网 发布时间:2015-02-21
本文导语: 我用一个session bean调用entity bean.数据库是mysql建立的,只有两个字段userid,name. session bean要调用的方法是下面: public String[] listnames(String name) { try { Context jndiContext =new InitialContext(); ...
我用一个session bean调用entity bean.数据库是mysql建立的,只有两个字段userid,name.
session bean要调用的方法是下面:
public String[] listnames(String name) {
try {
Context jndiContext =new InitialContext();
Object ref = jndiContext.lookup( "Acount1" ) ;
Acount1Home acount1Home = (Acount1Home) PortableRemoteObject.narrow(ref, Acount1Home.class);
Vector vect = new Vector();
vect.addElement("access ejb");
Acount1 acount1 = null;
Acount1PK pk = null;
for (int i=1;i
session bean要调用的方法是下面:
public String[] listnames(String name) {
try {
Context jndiContext =new InitialContext();
Object ref = jndiContext.lookup( "Acount1" ) ;
Acount1Home acount1Home = (Acount1Home) PortableRemoteObject.narrow(ref, Acount1Home.class);
Vector vect = new Vector();
vect.addElement("access ejb");
Acount1 acount1 = null;
Acount1PK pk = null;
for (int i=1;i