コード例 #1
0
 public PartyLovDAO() {
   try {
     dataSource = LookUpBean.getDataSource();
   } catch (Exception nmEx) {
     nmEx.printStackTrace();
   }
 }
コード例 #2
0
 public void setSessionContext(SessionContext sessionCtx) {
   this.sessionContext = sessionCtx;
   try {
     dataSource = LookUpBean.getDataSource();
   } catch (Exception e) {
     throw new RuntimeException("Unable To LookUp the DataSource");
   }
 }
コード例 #3
0
 /** @return */
 private Connection getConnection() {
   DataSource ds = null;
   // InitialContext		ic		=		null;//commented  by nagaja for performance tuning on 23-09-2008
   Connection con = null;
   try {
     // modified by nagaja for performance tuning on 23-09-2008
     /*	ic		=	new InitialContext();
     ds		=	(DataSource)ic.lookup("java:comp/env/jdbc/DB");*/
     ds = LookUpBean.getDataSource();
     con = ds.getConnection();
   } catch (Exception ex) {
     Logger.error(FILE_NAME, "Exception in getConnection() : " + ex);
   }
   return con;
 }