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

您没有登录

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

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:谁解决过这样的问题? [Re:jameszhang]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2003-03-06 14:04 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
那你看我这样关闭的是不是有错呢?另外如果我刷新的很慢,WEBLOGIC 是不抛出异常的,这点我刚才没有声明,请高手帮帮忙!!谢谢!

public class MyEJBBean implements SessionBean
{
SessionContext sessionContext;
private javax.sql.DataSource jdbcFactory;
private Connection connection=null;

public void ejbCreate() throws CreateException {
/**@todo Complete this method*/
Context c = null;
if (this.jdbcFactory == null) {
try {
c = new InitialContext();
this.jdbcFactory = (javax.sql.DataSource)
c.lookup("myData");
} catch (Exception e){ System.out.println("Error: " + e); }
}

}
public void ejbRemove()
{
/**@todo Complete this method*/
}
public void ejbActivate()
{
/**@todo Complete this method*/
}
public void ejbPassivate()
{
/**@todo Complete this method*/
}
public void setSessionContext(SessionContext sessionContext)
{
this.sessionContext = sessionContext;
}
//////////////////////////////////////////////////////////
private void getDBConnection() throws SQLException
{
try{
connection=this.jdbcFactory.getConnection();
}catch(Exception xxe)
{
System.out.println("getDBConnection Error :"+xxe);

}

}
///////////////////////////////////////////////////////
public int getCount()
{
int iRet=0;
try{
this.getDBConnection();
AccessDAO adao=new AccessDAO();

iRet=adao.getCount(connection);

connection.close();

}catch(Exception xe)
{
System.out.println("get Count Error:"+xe);
}
return iRet;
}

}




话题树型展开
人气 标题 作者 字数 发贴时间
17587 谁解决过这样的问题?(快速多次调用后,WEBLOGIC 抛出 无可用JDBCRESOURCE 异常) jameszhang 103 2003-03-06 10:52
14662 Re:谁解决过这样的问题? youlq 29 2003-03-06 11:00
19640 Re:谁解决过这样的问题? jameszhang 41 2003-03-06 11:59
14049 Re:谁解决过这样的问题? SimonLei 140 2003-03-06 12:26
16212 Re:谁解决过这样的问题? jameszhang 1629 2003-03-06 14:04
14100 Re:谁解决过这样的问题? SimonLei 30 2003-03-06 14:30
18590 Re:谁解决过这样的问题? jameszhang 112 2003-03-06 16:37
14028 Re:谁解决过这样的问题? SimonLei 401 2003-03-06 18:37
17836 Re:谁解决过这样的问题? jameszhang 119 2003-03-06 20:13
13929 Re:谁解决过这样的问题? SimonLei 30 2003-03-06 20:53
17648 Re:谁解决过这样的问题? jameszhang 175 2003-03-06 21:10
14018 Re:谁解决过这样的问题? SimonLei 186 2003-03-06 21:51
14079 Re:谁解决过这样的问题? floater 182 2003-03-07 00:32
17890 Re:谁解决过这样的问题? jameszhang 170 2003-03-07 09:01
14581 Re:谁解决过这样的问题? gunrose 1725 2003-03-07 10:09

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