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 A6D309DCA64 for ; Thu, 19 Jan 2006 05:54:24 -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 79924-02 for ; Thu, 19 Jan 2006 05:54:25 -0400 (AST) X-Greylist: delayed 16:57:57.999402 by SQLgrey- Received: from fmmailgate04.web.de (fmmailgate04.web.de [217.72.192.242]) by postgresql.org (Postfix) with ESMTP id 718399DC841 for ; Thu, 19 Jan 2006 05:54:21 -0400 (AST) Received: by fmmailgate04.web.de (8.12.10/8.12.10/webde Linux 0.7) with SMTP id k0J9s3v2017010 for ; Thu, 19 Jan 2006 10:54:22 +0100 Received: from [213.223.114.15] by freemailng1505.web.de with HTTP; Thu, 19 Jan 2006 10:54:20 +0100 Date: Thu, 19 Jan 2006 10:54:20 +0100 Message-Id: <769443163@web.de> MIME-Version: 1.0 From: Marc SCHNEIDER To: pgsql-jdbc@postgresql.org Subject: Re: PGConnection (LargeObject) / JNDI Tomcat Issue Precedence: fm-user Organization: http://freemail.web.de/ Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200601/95 X-Sequence-Number: 14546 "Marc SCHNEIDER" schrieb am 19.01.06 10:52:49: Hello, Thank you for your answers, it really helps me. So the solution with getInnermostDelegate() method works.=20 Just don't forget to put the dbcp property 'accessToUnderlyingConnectionAl= lowed' to true before. But I will post another message with a different topic : I wonder which class in the jdbc driver you can use if you want to replace= the org.apache.commons.dbcp.BasicDataSourceFactory one. Thank you, Marc. Mark Lewis schrieb am 18.01.06 20:14:03: 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 =3F=3F=3F > > > > Regards, > > Marc SCHNEIDER. > > =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =20 > > =5F=5F=5F=5F > > Erweitern Sie FreeMail zu einem noch leistungsst=E4rkeren E-Mail-=20 > > Postfach! =09 > > Mehr Infos unter http://freemail.web.de/home/landingpad/=3Fmc=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=3F >=20 > http://www.postgresql.org/docs/faq ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= Erweitern Sie FreeMail zu einem noch leistungsstarkeren E-Mail-Postfach! =09 Mehr Infos unter http://freemail.web.de/home/landingpad/=3Fmc=3D021131