pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tfinneid@student.matnat.uio.no
To: pgsql-jdbc@postgresql.org
Cc: kato@iki.fi
Subject: pg jdbc and dbcp error
Date: Mon, 1 Oct 2007 16:20:30 +0200 (CEST)
Message-ID: <34154.134.32.140.234.1191248430.squirrel@webmail.uio.no> (raw)

Hi

I am having problems getting apache DBCP to work with pg jdbc.
It is claiming it can't convert a Connection into a PGConnection.

the sentence throws the exception is something like this:

    Connection con = ds.getConnection()    \\ DBCP BasicDataSource
   ((PGConnection)con).getCopyAPI.copyIntoDB("COPY attr (val1) from
STDIN"), stream);

the error message is (the message is handcopied so I might make mistakes)

ClassCastException:
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper can
not be cast to org.postgresql.PGConnection


Anybody got any ideas whats wrong? the getConnection() returns a
javax.sql.Connection object, so casting it to PGConnection should not be a
problem.

Using the driver
   podtgresql-jdbc-8.2-505-copy-20070719.jdbc3.jar

which contains a pathc for COPY functionality
(http://kato.iki.fi/sw/db/postgresql/jdbc/copy/)




view thread (5+ messages)  latest in thread

Message-ID: <34154.134.32.140.234.1191248430.squirrel@webmail.uio.no>
Permalink:  ../34154.134.32.140.234.1191248430.squirrel@webmail.uio.no/
Also on:    postgresql.org/message-id/34154.134.32.140.234.1191248430.squirrel@webmail.uio.no

 · 

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: tfinneid@student.matnat.uio.no, kato@iki.fi
  Subject: Re: pg jdbc and dbcp error
  In-Reply-To: <34154.134.32.140.234.1191248430.squirrel@webmail.uio.no>
  References: <34154.134.32.140.234.1191248430.squirrel@webmail.uio.no>

* 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