Re: JDBC driver writes binary data ONLY as Large Object

From: Bill <bouma(at)cplane(dot)com>
To: 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 Object
Date: 2000-08-03 19:45:44
Message-ID: 3989CBE8.1BBF9535@cplane.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Craig Orsinger 2000-08-03 23:49:49 RE: ODBC driver on NT client
Previous Message Lamar Owen 2000-08-03 16:30:40 Re: Re: And Furthermore. Was: PSQL Working, but PGAccess Not Connecting.