Hi Jay,

no, you can use JNDI, I'm using the following:

  /**
   * Gets current connection to the connection pool.
   *
   * @return                  Connection
   * @exception               javax.ejb.EJBException
   *                          if there is a communications or systems failure
   */
    private Connection getConnection()
        throws SQLException{
        InitialContext initCtx = null;
        DataSource ds = null;
        try {
            initCtx = new InitialContext();
            ds = (javax.sql.DataSource)initCtx.lookup("java:comp/env/jdbc/dsnname");
            this.conn = ds.getConnection();

        } catch(NamingException ne) {
            System.out.println("UNABLE to get a connection from dsnname Pool!");
            System.out.println("Please make sure that you have setup the connection pool properly");
            System.out.println(ne);
        } finally {
            try {
                if(initCtx != null) initCtx.close();
            } catch(NamingException ne) {
                System.out.println("Error closing context: " + ne);
                System.out.println(ne);
            }
        }
        return this.conn;
    }

Regard's

Marcelo Bellezo

Jay Walters wrote:

>From the docs it looks like the only valid way to do this inside JRun is
ResourceManager.getConnection, and that I cannot use a JNDI lookup?  Is this
true?

Cheers
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to