Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CCDC36330CD for ; Sun, 12 Jul 2009 21:57:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 48429-08 for ; Sun, 12 Jul 2009 21:57:15 -0300 (ADT) X-Greylist: delayed 00:05:50.955107 by SQLgrey-1.7.6 Received: from habenero.xigole.com (habanero.xigole.com [64.85.172.184]) by mail.postgresql.org (Postfix) with ESMTP id 0D45D632D83 for ; Sun, 12 Jul 2009 21:57:23 -0300 (ADT) Received: from [192.168.0.16] (70-59-10-120.hlrn.qwest.net [70.59.10.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by habenero.xigole.com (Postfix) with ESMTPSA id 5BA8C10128A6 for ; Sun, 12 Jul 2009 18:51:29 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=xigole.com; s=mail; t=1247446289; bh=Gv5onxHaLbVrGgrKTmUQwilyY7XI7Zv4DrXVkFBAtvU=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type; b=UuwPE+U2m4/twA54mccvbfkugKau3MVdCQiuXX lImW2IbHo8VE+gMbGZKUrLTM8ansfYEkHC6/i3IC6u+Ww3edrbsNZg4f+CYJMu3pqkF QHiBmeCwffPRNyvhlEFqp+7YSiaAzvw6MPldXOvfnaYbgpVcYVHXQnHibxMs2WBR78= Message-ID: <4A5A850A.7080505@xigole.com> Date: Sun, 12 Jul 2009 18:51:22 -0600 From: Scott Dunbar User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: javax.sql.DataSource implementation References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------000607080108060900080603" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200907/20 X-Sequence-Number: 19788 This is a multi-part message in MIME format. --------------000607080108060900080603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 > --------------000607080108060900080603 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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:
javax.sql.DataSource implementation

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


--------------000607080108060900080603--