tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Einsle <>
Subject Access zu an jdbc Datasource
Date Tue, 31 Aug 2004 13:02:03 GMT
Hello List,

I'm trying zu connect to an JDBC Datasource connecting to an Postgres 
Database. But it will not work.

I tryed it link the Documentation, adding the Datasource under 
GlobalNamingResources, and add the another in web.xml.

In ProgrammSource:

--- cut ---
Context initContext = new InitialContext();
Context envContext = (Context)initContext.lookup("java:/comp/env");
DataSource ds = (DataSource)envContext.lookup("jdbc/postgres");
Connection conn = ds.getConnection();
--- cut ---

The another is link the description in the JDBC Howto.

While ds.getConnection() i recieved an Exception, cannot connect to 
Datasource name ''.

Searchin a little bit, i cannot find the Environment for the 

Does anyone has an Idea / Howto i can lokk about my Problem??

Thanks for Help


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message