Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 56781 invoked from network); 22 Feb 2003 01:38:31 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 22 Feb 2003 01:38:31 -0000 Received: (qmail 5372 invoked by uid 97); 22 Feb 2003 01:40:13 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@nagoya.betaversion.org Received: (qmail 5365 invoked from network); 22 Feb 2003 01:40:13 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 22 Feb 2003 01:40:13 -0000 Received: (qmail 53957 invoked by uid 500); 22 Feb 2003 01:37:59 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 63274 invoked from network); 21 Feb 2003 21:39:09 -0000 Message-ID: From: =?iso-8859-1?Q?ARPON_Mart=EDn____________TECSIS?= To: "'Jakarta Commons Developers List'" Subject: RE: [DBCP] getConnection with credentials unsupported Date: Fri, 21 Feb 2003 18:38:30 -0300 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable x-mailer1: esmtp x-mailer2: esmtppub X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ok, I see the point. What about checking if the passed credentials are = the same as the ones we 're are creating connections with and in that case return a connection and in others throw an exception ? -----Original Message----- From: PUB: Craig R. McClanahan [mailto:craigmcc@apache.org]=20 Sent: Friday, February 21, 2003 5:39 PM To: Jakarta Commons Developers List Cc: marpon@tecsis.com Subject: Re: [DBCP] getConnection with credentials unsupported On Fri, 21 Feb 2003, ARPON Mart=EDn TECSIS wrote: > Date: Fri, 21 Feb 2003 12:57:04 -0300 > From: ARPON Mart=EDn TECSIS > Reply-To: Jakarta Commons Developers List=20 > > To: "'commons-dev@jakarta.apache.org'" = > Subject: [DBCP] getConnection with credentials unsupported > > I see from PoolingDataSource that getConnection(String uname, String=20 > passwd) is not implemented and throws UnsupportedOperationException. > > The problem with this is that it prevents using Sun 's RowSet=20 > implementation, at least, CachedRowSet > = (http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.h > tml) > > This code doesn 't work when "jdbc/coffeesDB" gets a=20 > dbcp.PoolingDataSource: > > > CachedRowSet crset =3D new CachedRowSet(); > crset.setCommand("SELECT * FROM COFFEES"); > crset.setDataSourceName("jdbc/coffeesDB"); > crset.execute(); > > > >From what I see, RowSets with DataSources appear to always call > getConnection(username, password), even when crset.setUsername() and > crset.setPassword() haven 't been used. > > Changing the code like this works: > > public Connection getConnection(String uname, String passwd) throws=20 > SQLException { > //throw new UnsupportedOperationException(); > return getConnection(); > } > > My question is: are there any plans to implement this method? Or, is=20 > there any chance to get a standard connection instead of throwing and = > exception ? > I would be -1 on such a patch. This would create security = vulnerabilities for people who believed that the returned connection really did have = only the privileges of the specified username and password. > Regards, > > Martin > > If you wish to reply, please CC me because I 'm not subscribed.=20 > Thanks. > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org