} catch (Exception e) {
}
finally {
if(rs!=null) rs.close();
if(st!=null) st.close();
if(conn!=null) conn.close();
e.printStackTrace();
return resl;
2. 部署EJB
3. 测试SessionBean
public class test{
public void run() {
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
try {
Context ctx = new InitialContext(p);
Object obj = ctx.lookup("testBean");
testHome home = (testHome) PortableRemoteObject.narrow(obj, testHome.class);
test t = home.create();
System.out.println("test...");
String str = t.testDS();
System.out.println("received: \n" + str);
System.out.println("test finished!\n");
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18