RE: JDBC driver writes binary data ONLY as Large Obj ect - Mailing list pgsql-interfaces

From Peter Mount
Subject RE: JDBC driver writes binary data ONLY as Large Obj ect
Date
Msg-id 1B3D5E532D18D311861A00600865478CF1B1B5@exchange1.nt.maidstone.gov.uk
Whole thread Raw
List 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@cplane.com]
Sent: Wednesday, August 02, 2000 8:57 PM
To: Peter Mount
Cc: pgsql-interfaces@postgresql.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




pgsql-interfaces by date:

Previous
From: "David Lloyd-Jones"
Date:
Subject: Re: Re: And Furthermore. Was: PSQL Working, but PGAccess Not Connecting.
Next
From: Antonio Navarro Navarro
Date:
Subject: Re: Python + PostgreSQL