RE: JDBC driver writes binary data ONLY as Large Obj ect

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Bill'" <bouma(at)cplane(dot)com>, Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: RE: JDBC driver writes binary data ONLY as Large Obj ect
Date: 2000-08-03 06:42:06
Message-ID: 1B3D5E532D18D311861A00600865478CF1B1B5@exchange1.nt.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hmmm, I see your point. There must be some way of encoding the string so
that the data is stored correctly. I know certain control characters can be
stored (cr/lf's etc) as I have a PHP script that does it here.

Is it the new String(bytes[]) bit that barfs, or is it that the data is
mungled when it's re-read from the table?

Peter

--
Peter Mount
Enterprise Support
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council

-----Original Message-----
From: Bill [mailto:bouma(at)cplane(dot)com]
Sent: Wednesday, August 02, 2000 8:57 PM
To: Peter Mount
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] JDBC driver writes binary data ONLY as Large
Object

Peter Mount wrote:

> The problem here is that there is no metadata available to check.
>
> If the backend was able to precompile the query, then we would know the
> column type, but as it stands currently there is no way of finding out
what
> the column type is.
>
> Peter

Ok. Suppose there was metadata available. How would you
rewrite the function PreparedStatement.writeBytes() such that
it writes the bytes directly into the column? Since that class
does everything through heavy use of String manipulation, I
can't see how to do it. Is there a way? I tried this:

public void setBytes(int parameterIndex, byte x[]) throws SQLException
{
set(parameterIndex, new String(x));
}

It barfed.

Bill

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Antonio Navarro Navarro 2000-08-03 07:02:43 Re: Python + PostgreSQL
Previous Message David Lloyd-Jones 2000-08-03 06:08:43 Re: Re: And Furthermore. Was: PSQL Working, but PGAccess Not Connecting.