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 82D459DC9E6 for ; Wed, 18 Jan 2006 15:13:35 -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 08640-02 for ; Wed, 18 Jan 2006 15:13:35 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mir3-fs.mir3.com (mail.mir3.com [65.208.188.100]) by postgresql.org (Postfix) with ESMTP id 4BE519DC9E1 for ; Wed, 18 Jan 2006 15:13:33 -0400 (AST) Received: mir3-fs.mir3.com 172.16.1.11 from 172.16.2.68 172.16.2.68 via HTTP with MS-WebStorage 6.0.6249 Received: from archimedes.mirlogic.com by mir3-fs.mir3.com; 18 Jan 2006 11:13:33 -0800 Subject: Re: PGConnection (LargeObject) / JNDI Tomcat Issue From: Mark Lewis To: Marc SCHNEIDER Cc: pgsql-jdbc@postgresql.org In-Reply-To: <1E7BC982-3287-4E97-A29D-8DB51786F605@fastcrypt.com> References: <768569414@web.de> <1E7BC982-3287-4E97-A29D-8DB51786F605@fastcrypt.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Organization: MIR3, Inc. Date: Wed, 18 Jan 2006 11:13:33 -0800 Message-Id: <1137611613.17090.33.camel@archimedes> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-22) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.121 required=5 tests=[AWL=0.120, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.121 X-Spam-Level: X-Archive-Number: 200601/92 X-Sequence-Number: 14543 Marc, Here's some sample code: PGConnection pgCon =3D (PGConnection)((DelegatingConnection)con).getInnermostDelegate(); -- Mark Lewis On Wed, 2006-01-18 at 12:37 -0500, Dave Cramer wrote: > Marc, >=20 > Check dbcp's documentation, there is a way to get the underlying =20 > connection. >=20 > You will have to first cast to some dbcp connection, then get the =20 > connection and cast it. >=20 > Dave > On 18-Jan-06, at 11:56 AM, Marc SCHNEIDER wrote: >=20 > > Hello, > > > > I have trouble to get Tomcat and JDBC work with LargeObject. > > > > I am using JNDI for database access > > > > > type=3D"java.sql.DataSource"/> > > > > > > factory > > org.apache.commons.dbcp.BasicDataSourceFactory > value> > > > > > > driverClassName > > org.postgresql.Driver > > > > > > url > > jdbc:postgresql://localhost:5432/intradev > > > > > > username > > myuser > > > > > > password > > mypass > > > > > > > > Here is my code : > > > > LargeObjectManager lom =3D ((org.postgresql.PGConnection)=20 > > this.connection).getLargeObjectAPI(); > > > > I get the following error : > > > > java.lang.ClassCastException > > This is because the connection is an instance of =20 > > org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper > > and I'm trying to get a org.postgresql.PGConnection connection. > > > > I saw on the web that people used =20 > > org.postgresql.jdbc3.Jdbc3ObjectFactory but this class is available =20 > > with jdbc 7.x drivers only. > > > > I tried to use the org.postgresql.ds.common.PGObjectFactory class =20 > > but when I connect to the database I get the following error : > > "no PostgreSQL user name specified in startup packet" > > > > Here is my config : > > DB : PostgreSQL 8.0 > > Driver jdbc : postgresql-8.0-312.jdbc3.jar > > Java Server : Tomcat 5.0.28 > > Os : Win XP > > > > Any idea ??? > > > > Regards, > > Marc SCHNEIDER. > > ______________________________________________________________________=20 > > ____ > > Erweitern Sie FreeMail zu einem noch leistungsst=C3=A4rkeren E-Mail-=20 > > Postfach! =09 > > Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=3D021131 > > > > > > ---------------------------(end of =20 > > broadcast)--------------------------- > > TIP 5: don't forget to increase your free space map settings > > >=20 >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? >=20 > http://www.postgresql.org/docs/faq