Rajesh,
 
Not sure I answered your question completely.  The snippet from the weblogic.properties file will set up a connection pool.  Here's how you get a connection from that pool.
 
 private Connection getConnection()
    throws SQLException {
  Properties p = new Properties();
  p.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
  p.put(Context.PROVIDER_URL, "t3://*urlofweblogicserver*:*port*");
  p.put(Context.SECURITY_PRINCIPAL, "*login*");
        p.put(Context.SECURITY_CREDENTIALS, "*password*");
  InitialContext initCtx = null;
     try {
      initCtx = new InitialContext(p);
        DataSource ds = (javax.sql.DataSource)initCtx.lookup("weblogic.jdbc.jts.prototypePool");
        return ds.getConnection();
     } catch (NamingException ne) {
        // error
     } finally {
        try {
          if(initCtx != null)
     initCtx.close();
        } catch(NamingException ne) {
          // error
        }
     }
  
  return null;
   }

Reply via email to