Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 22859 invoked from network); 1 Sep 2004 06:35:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Sep 2004 06:35:24 -0000 Received: (qmail 3133 invoked by uid 500); 1 Sep 2004 06:34:11 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 3028 invoked by uid 500); 1 Sep 2004 06:34:10 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 2887 invoked by uid 99); 1 Sep 2004 06:34:07 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [62.159.255.106] (HELO mail.on-ergy.de) (62.159.255.106) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 31 Aug 2004 23:34:06 -0700 Received: from [127.0.0.1] (nf5100.on-ergy.lan [192.168.99.10]) by mail.on-ergy.de (Postfix) with ESMTP id 15E069524 for ; Wed, 1 Sep 2004 08:33:56 +0200 (CEST) Message-ID: <41356D49.5070606@einsle.de> Date: Wed, 01 Sep 2004 08:33:45 +0200 From: Robert Einsle User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7) Gecko/20040616 X-Accept-Language: de, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Access zu an jdbc Datasource References: <58308322565CAC4DB0B7845FA6959E2F01E3640C@cbebosex01.cbetech.local> In-Reply-To: <58308322565CAC4DB0B7845FA6959E2F01E3640C@cbebosex01.cbetech.local> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hy, It seems to work, very much Thanks. Greetings \Robby D'Alessandro, Arthur schrieb: >Try a resourcelink in your context for the webapp. > >Eg. >path="/yourwebappname" privileged="false" reloadable="true" >swallowOutput="true"> > type="javax.sql.DataSource"/> > > >-----Original Message----- >From: Robert Einsle [mailto:robert@einsle.de] >Sent: Tuesday, August 31, 2004 9:02 AM >To: Tomcat Users List >Subject: Access zu an jdbc Datasource > >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 >Postgresdatabasesource. > >Does anyone has an Idea / Howto i can lokk about my Problem?? > >Thanks for Help > >\Robby > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org