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 5D86F9DC83F for ; Wed, 18 Jan 2006 13:37:30 -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 86991-09 for ; Wed, 18 Jan 2006 13:37:29 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id D13719DC833 for ; Wed, 18 Jan 2006 13:37:25 -0400 (AST) Received: (qmail 6528 invoked from network); 18 Jan 2006 17:37:24 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 18 Jan 2006 17:37:24 -0000 In-Reply-To: <768569414@web.de> References: <768569414@web.de> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Message-Id: <1E7BC982-3287-4E97-A29D-8DB51786F605@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: quoted-printable From: Dave Cramer Subject: Re: PGConnection (LargeObject) / JNDI Tomcat Issue Date: Wed, 18 Jan 2006 12:37:23 -0500 To: Marc SCHNEIDER X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.126 required=5 tests=[AWL=0.126] X-Spam-Score: 0.126 X-Spam-Level: X-Archive-Number: 200601/90 X-Sequence-Number: 14541 Marc, Check dbcp's documentation, there is a way to get the underlying =20 connection. You will have to first cast to some dbcp connection, then get the =20 connection and cast it. Dave On 18-Jan-06, at 11:56 AM, Marc SCHNEIDER wrote: > 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=E4rkeren 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 >