pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joeseph Blowseph <joseph_blowseph@hotmail.com>
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
Message-ID: <BAY101-F29B2D2D6084DAEDD462E1283190@phx.gbl> (raw)
In-Reply-To: <43C96BF1.4000407@opencloud.com>

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 <oliver@opencloud.com>
>To: Joeseph Blowseph <joseph_blowseph@hotmail.com>
>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:
>>
>>  <native-data-source name="PGDS1"
>>    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 <native-data-source> 
>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




view thread (5+ messages)

Message-ID: <BAY101-F29B2D2D6084DAEDD462E1283190@phx.gbl>
Permalink:  ../BAY101-F29B2D2D6084DAEDD462E1283190@phx.gbl/
Also on:    postgresql.org/message-id/BAY101-F29B2D2D6084DAEDD462E1283190@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: joseph_blowseph@hotmail.com, oliver@opencloud.com
  Subject: Re: 'FATAL: database "null" does not exist ' when accessing through a
  In-Reply-To: <BAY101-F29B2D2D6084DAEDD462E1283190@phx.gbl>
  References: <43C96BF1.4000407@opencloud.com> <BAY101-F29B2D2D6084DAEDD462E1283190@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox