pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc SCHNEIDER <marco_2025@web.de>
To: pgsql-jdbc@postgresql.org
Subject: PGConnection (LargeObject) / JNDI Tomcat Issue
Date: Wed, 18 Jan 2006 17:56:23 +0100
Message-ID: <768569414@web.de> (raw)

Hello,

I have trouble to get Tomcat and JDBC work with LargeObject.

I am using JNDI for database access

 <Resource name="jdbc/aguila" auth="Container" type="java.sql.DataSource"/>
    <ResourceParams name="jdbc/aguila">
        <parameter>
            <name>factory</name>
            <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        </parameter>
	<parameter>
	    <name>driverClassName</name>
	    <value>org.postgresql.Driver</value>
	</parameter>
	<parameter>
	    <name>url</name>
	    <value>jdbc:postgresql://localhost:5432/intradev</value>
	</parameter>
	<parameter>
	    <name>username</name>
	    <value>myuser</value>
	</parameter>
	<parameter>
	    <name>password</name>
	    <value>mypass</value>
	</parameter>
    </ResourceParams>

Here is my code :

      LargeObjectManager lom = ((org.postgresql.PGConnection)this.connection).getLargeObjectAPI();

I get the following error :

java.lang.ClassCastException
This is because the connection is an instance of 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 org.postgresql.jdbc3.Jdbc3ObjectFactory but this class is available with jdbc 7.x drivers only.

I tried to use the org.postgresql.ds.common.PGObjectFactory class 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.
__________________________________________________________________________
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!		
Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131




view thread (6+ messages)  latest in thread

Message-ID: <768569414@web.de>
Permalink:  ../768569414@web.de/
Also on:    postgresql.org/message-id/768569414@web.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: marco_2025@web.de
  Subject: Re: PGConnection (LargeObject) / JNDI Tomcat Issue
  In-Reply-To: <768569414@web.de>
  References: <768569414@web.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox