From: Scott Dunbar <scott@xigole.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: javax.sql.DataSource implementation
Date: Sun, 12 Jul 2009 18:51:22 -0600
Message-ID: <4A5A850A.7080505@xigole.com> (raw)
In-Reply-To: <D4C7AEF079ED754EA6182024DE2DB07803BD68F9@mucmail4.sdm.de>
References: <D4C7AEF079ED754EA6182024DE2DB07803BD68F9@mucmail4.sdm.de>
Diego,
I think you're missing an important understanding regarding JDBC and a
DataSource. A DataSource is obtained from the container (for example,
Tomcat) that your application is running in. There are a few reasons to
do this. The most important is to separate the configuration of your
database connection from your source code. In pure JDBC you do all of
the connection configuration yourself - setting the user name, password,
driver, and so on. A DataSource, which is acquired through JNDI puts
all of the configuration of the database connection outside of your code
and makes it available to your application (or other applications or web
apps).
The downside of this is that each application server configures this
differently. WebLogic does it differently than Tomcat and they are both
different than WebSphere. Engines like JBoss and Glassfish muddy the
waters more. They embed Tomcat but have different ways of setting up
the JDNI DataSource.
I don't know what application server you're using but Tomcat has a great
page at
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
that includes a PostgreSQL specific section. If you're using a
different app server then you'll want to read the docs on how to get it
setup.
diego.vera@capgemini-sdm.com wrote:
>
> Hi all,
>
> I am using Jsecurity with postgresql and I require an implementation
> of the javax.sql.DataSource, I reviewed the source code of the jdbc
> driver and It seems that it is not implemented. Do you know where
> could I get it? Or should I implement my DataSource? I thouhg it
> should be part of the jdbc driver.
>
> Best regards,
>
> -Diego Vera
>
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: scott@xigole.com
Subject: Re: javax.sql.DataSource implementation
In-Reply-To: <4A5A850A.7080505@xigole.com>
References: <D4C7AEF079ED754EA6182024DE2DB07803BD68F9@mucmail4.sdm.de> <4A5A850A.7080505@xigole.com>
* 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