Caldarale, Charles R wrote:
>> From: Neil Youngman [mailto:neil.young...@wirefast.com]
>> Subject: RE: [ERROR] Cannot create JDBC driver of class '' for connect
>> URL 'null'
>>
>>     private static final String DB_NAME = "jdbc/InterceptDatabase";
>
> But your <Context> has:
>
> <Resource name="jdbc/AppDatabase"

Oops. It's late in the day and I'm getting careless. That's from a different 
application. I'll try to copy from the correct editor window this time.

    private static final String CONTEXT_NAME = "java:/comp/env";
    private static final String DB_NAME = "jdbc/AppDatabase";

 ...

    private static Connection getConnection ()
        throws Exception, SQLException
    {
        if( DATA_SOURCE == null )
        {
            // Get the data source (from context.xml)
            try
            {
                Class.forName("oracle.jdbc.OracleDriver");
                Context initContext = new InitialContext();
                Context envContext = (Context) initContext.lookup(CONTEXT_NAME);
                DATA_SOURCE = (DataSource)envContext.lookup(DB_NAME);
            }
            catch (Exception ex)
            {
                System.err.println( ex );
                ex.printStackTrace();
                throw ex;
            }
        }

        return DATA_SOURCE.getConnection(); // line 208
    }

Neil Youngman

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to