Re: problem using JNDIDataSource

From: Tore Halset (halse..vv.ntnu.no)
Date: Wed Aug 13 2003 - 04:07:04 EDT

  • Next message: Martin Dengler: "using aggregate functions in select statements"

    On Tue, 12 Aug 2003, Eric Schneider wrote:

    > It looks like your datasource isn't configured properly. See if your
    > servlet container has JNDI examples bundled with it. It should show you
    > how to create a shared datasource resource that all applications in your
    > container can link to.

    I think the datasource sould be ok. I can get a DataSource with the
    following code:

    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource)ic.lookup("java:/myappDS");

    But the JNDIDataSourceFactory are doing it a bit different:

    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    DataSource ds = (DataSource)envCtx.lookup(location);

    And that code does not find a DataSource with location="java:/myappDS".

     - Tore.



    This archive was generated by hypermail 2.0.0 : Wed Aug 13 2003 - 03:59:56 EDT