The JNDI namespace you want is
java:comp/env
and not java:/comp/env
But I'm not sure if is the cause of the problem.
Alfonso Martinez wrote:
>Hi Paul,
>
>I am a newbie too, but trying to help. I had a problem like yours recently and found
>an error in my server.xml. I know you checked that file already, but can you send
>those (also web.xml) files to me please to see what I can do? Thanks
>
>Jose
>
>On Fri, Sep 20, 2002 at 11:10:41AM -0500, Paul Salazar wrote:
>
>
>>Hi,
>>
>>I am trying to setup a postgresql datasource on tomcat 4.1 with much
>>frustration.
>>I have read all the threads out there concerning this matter and I can't
>>see to
>>find anyone who has a working example. What I have is this:
>>
>>Redhat 7.2 server running:
>>Postgresql 7.2
>>Tomcat 4.1
>>
>>I have a working Tomcat app that can connect to the Db and perform
>>queries when manually loading the driver
>>'Class.forName("org.postgresql.Driver");
>>and then doing a getConnection using the URL, Name, Password.
>>
>>But when trying to get a connection using a Datasource, as in,
>>
>>Context ctx = new InitialContext();
>>Context envctx = (Context)ctx.lookup("java:/comp/env");
>>DataSource ds = (DataSource)envctx.lookup("jdbc/postgres"); //jndi name
>>of the datasource
>>Connection conn = ds.getConnection();
>>
>>the getConnection() statement throws an SQLException: Cannot load JDBC
>>driver class 'null'
>>
>>I have gone over all the server.xml and web.xml files with a fine tooth
>>comb and assure
>>you that is not the problem. I have also tried using the jxDBCon drivers
>>with the same
>>results. I have come to the conclusion that it must be a tomcat problem.
>>Has anyone
>>gotten this to work with this config??
>>
>>Paul Salazar
>>
>>
>>
>
>
>
>>--
>>To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>>
>
>--
>To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>