Обсуждение: bytea not recognized by JDBC (7.0.2)
I have a problem with JDBC (postgresql.jar) and Postgres 7.0.2 . The client is under Windows NT with JDK 1.3, and Postgres is running on SuSE Linux 6.3 (kernel 2.2.13). Here is my table : create table TRANSACTIONS ( APPLICATION_SOFTWARE_RELEASE bytea not null, ); I insert a row (using JDBC) with success : insert into TRANSACTIONS(APPLICATION_SOFTWARE_RELEASE) values('0005'); I select a row (with JDBC) : select APPLICATION_SOFTWARE_RELEASE from TRANSACTIONS; and I get the following error : Error while processing order (select APPLICATION_SOFTWARE_RELEASE from TRANSACTIONS ) : No class found for bytea. How can I select a "bytea" field ? Is there a workaround for this, or a patch ? Is this a bug of the JDBC driver (or a not implemented feature) ? I have looked at the mailing-list but didn't find the answer to my problem. Regards, -- Olivier Jeannet - e-Payment solutions I prefer not running 32 bit extensions for a 16 bit patch to an 8 bit operating systemoriginally coded for a 4 bit microprocessor, written by a 2 bit company, that can't stand 1 bit of competition.
-- Peter Mount Enterprise Support Officer, Maidstone Borough Council Email: petermount@maidstone.gov.uk WWW: http://www.maidstone.gov.uk All views expressed within this email are not the views of Maidstone Borough Council > -----Original Message----- > From: Olivier Jeannet [mailto:jeannet@montrouge.tt.slb.com] > Sent: Tuesday, November 28, 2000 4:42 PM > To: pgsql-interfaces@postgresql.org > Subject: [INTERFACES] bytea not recognized by JDBC (7.0.2) [snip] > How can I select a "bytea" field ? getBytes() should work. > Is this a bug of the JDBC driver (or a not implemented feature) ? No not quite. getObject() currently doesn't know about bytea, so it's passing it on to the Serializable code which is then failing. > I have looked at the mailing-list but didn't find the answer to my > problem. Actually I cant remember anyone asking about bytea, which is why it's got overlooked. Peter
Peter Mount wrote: > > How can I select a "bytea" field ? > > getBytes() should work. Can you be more precise please ? As I get an error from the JDBC driver doing the select, on what variable should I use getBytes() ? > > Is this a bug of the JDBC driver (or a not implemented feature) ? > > No not quite. getObject() currently doesn't know about bytea, so it's > passing it on to the Serializable code which is then failing. And what is the solution or work around ? Regards, -- Olivier Jeannet - e-Payment solutions I prefer not running 32 bit extensions for a 16 bit patch to an 8 bit operating systemoriginally coded for a 4 bit microprocessor, written by a 2 bit company, that can't stand 1 bit of competition.