From: Bill <bouma@cplane.com>
To: Peter Mount <petermount@it.maidstone.gov.uk>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: JDBC driver writes binary data ONLY as Large Object
Date: Thu, 03 Aug 2000 12:45:44 -0700
Message-ID: <3989CBE8.1BBF9535@cplane.com> (raw)
References: <1B3D5E532D18D311861A00600865478CF1B1B5@exchange1.nt.maidstone.gov.uk>
Peter Mount wrote:
> 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?
-------------------------------------------
java.sql.SQLException: ERROR: parser: parse error at or near ""
at org.postgresql.Connection.ExecSQL(Connection.java, Compiled Code)
at org.postgresql.jdbc2.Statement.execute(Statement.java, Compiled Code)
at org.postgresql.jdbc2.Statement.executeUpdate(Statement.java:73)
at
org.postgresql.jdbc2.PreparedStatement.executeUpdate(PreparedStatement.java:126)
-------------------------------------------
Perhaps we can look at the ResultSet.getBytes() and just do the inverse of
that? Though I haven't tested if getBytes() is doing the right thing yet,
either.
In the end I need to be able to store/retrieve the data through both JDBC and
ODBC interface. This is working now if I store all binary data as Large
Objects. But most of my blobs of binary are only 200-2000 bytes long. I
assume it is much less efficient to store such small blobs as LOs? That is,
assuming the driver code is written well. So that may not be true with the
current JDBC driver given that it would first have to convert the binary
blob into a String. 8^(
Bill
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 using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: bouma@cplane.com, petermount@it.maidstone.gov.uk
Subject: Re: JDBC driver writes binary data ONLY as Large Object
In-Reply-To: <3989CBE8.1BBF9535@cplane.com>
* 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