比这篇新的文章: ww
比这篇旧的文章: 千字文有没有重复字?

aa

语言: Java Server Page, 标签: 无  2008/06/22发布 1年前更新
作者: catslender, 点击829次, 评论(0), 收藏者(0), , 打分:

背景
主题: 字体:
Java Server Page语言: aa
01 public class ControllerServlet extends HttpServlet
02   {
03   private javax.sql.DataSource testDS = null;
04   public void init(ServletConfig config) throws ServletException
05   {
06   super.init(config);
07   Context ctx = null;
08   try
09   {
10   ctx = new InitialContext();
11   testDS = (javax.sql.DataSource)ctx.lookup("jdbc/testDS");
12   }
13   catch(NamingException ne)
14   {
15   ne.printStackTrace();
16   }
17   catch(Exception e)
18   {
19   e.printStackTrace();
20   }
21   }
22   public javax.sql.DataSource getTestDS()
23   {
24   return testDS;
25   }
26   ...
27   ...
28   }


所有评论,共0条:( 我也来说两句)


发表评论

注册登录后再发表评论