X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 6629C9DC888 for ; Sat, 14 Jan 2006 18:05:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63374-08 for ; Sat, 14 Jan 2006 18:05:28 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hotmail.com (bay101-f29.bay101.hotmail.com [64.4.56.39]) by postgresql.org (Postfix) with ESMTP id 523FC9DD93D for ; Sat, 14 Jan 2006 18:05:24 -0400 (AST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 14 Jan 2006 14:05:26 -0800 Message-ID: Received: from 64.4.56.200 by by101fd.bay101.hotmail.msn.com with HTTP; Sat, 14 Jan 2006 22:05:26 GMT X-Originating-IP: [81.159.236.18] X-Originating-Email: [joseph_blowseph@hotmail.com] X-Sender: joseph_blowseph@hotmail.com In-Reply-To: <43C96BF1.4000407@opencloud.com> From: "Joeseph Blowseph" To: oliver@opencloud.com Cc: pgsql-jdbc@postgresql.org Subject: Re: 'FATAL: database "null" does not exist ' when accessing through a Date: Sat, 14 Jan 2006 22:05:26 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 14 Jan 2006 22:05:26.0522 (UTC) FILETIME=[9FC83DA0:01C61956] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.628 required=5 tests=[AWL=-0.291, DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44, MSGID_FROM_MTA_HEADER=0] X-Spam-Score: 1.628 X-Spam-Level: * X-Archive-Number: 200601/63 X-Sequence-Number: 14514 Thanks for the comprehensive answer. I was assuming that the container was parsing the database name from the URL. I've also been running into an "Invalid Oracle URL" error while I've been trying to get this working. That didn't seem to make much sense when the driver specified is Postgres. I think the two errors may be related. Oracle profess their container to be database-independent, but I'm not so sure! I have a thread open in the Oracle forum and I did feel that the problem lies with them; I just thought I'd ask here to see if I could get any further clarification. And I did :-) >From: Oliver Jowett >To: Joeseph Blowseph >CC: pgsql-jdbc@postgresql.org >Subject: Re: [JDBC] 'FATAL: database "null" does not exist ' when accessing >through a datasource >Date: Sun, 15 Jan 2006 10:24:01 +1300 > >Joeseph Blowseph wrote: >>The datasource construction parameters are stored in a data-sources xml >>file like this: >> >> > data-source-class="org.postgresql.ds.PGPoolingDataSource" >> jndi-name="jdbc/PGPooling" >> user="postgres" password="password" >> url="jdbc:postgresql://localhost:5432/PGSQL1"/> >> >>... >> >>The program code does a jdni lookup for the DataSource. That means that >>you don't have to hard-code connection details into the source. But, as >>things stand, I have to hard-code the database name. > >Sorry, I guess I wasn't clear. > >Your container will be constructing a PGPoolingDataSource object, then >calling various JavaBean-property-style methods on it to initialize it. >These are methods such as setUser(), setPassword(), and setDatabaseName(). > >When PGPoolingDataSource is asked for a connection, it constructs a driver >URL from the various properties it is configured with and then requests a >connection with that URL. > >The set of properties provided by a particular DataSource implementation >can vary -- the container is meant to use introspection to find and invoke >the property accessors. > >PGPoolingDataSource does not have a "url" property, it does not provide >setURL() or similar. So I don't know what the container is doing with that >"url" parameter, but it's not being set on the DataSource for sure. As the >URL you specify never makes it to the DataSource, it's not suprising that >the information you specify there is not used. > >You need to persuade your container to call the JavaBean accessor >setDatabaseName() on the DataSource before use. Perhaps you could try >adding an attribute called databaseName to your >configuration element above? > >This is why manually calling setDatabaseName fixes the "problem" -- but >it's the container's job to call it, as you say. So complain to your >container's vendor.. the PG datasource is working as designed, AFAIK. > >-O _________________________________________________________________ Are you using the latest version of MSN Messenger? Download MSN Messenger 7.5 today! http://messenger.msn.co.uk