Re: binary data - Mailing list pgsql-jdbc

From Werner Donné
Subject Re: binary data
Date
Msg-id loom.20101207T112628-767@post.gmane.org
Whole thread Raw
In response to binary data  ("Uwe Kubosch" <donv@crusaders.no>)
List pgsql-jdbc
> String query;
> ResultSet resultSet;
>
> query = "SELECT content FROM tfile WHERE id=4";
> resultSet = null;
>
> try {
>   boolean more;
>
>   resultSet = executeTheQuery(query);
>   more = resultSet.next();
>
>   if (more) {
>     InputStream is;
>
>     is = resultSet.getBinaryStream("content");
>     setContent(is);
>   }
> } catch (SQLException anSQLException) {
> }

Hi,

I have the same problem. I'm using PostgreSQL 9.0.1, which came with
postgresql-8.4-701.jdbc4.jar. The database is using the UTF8-encoding.
The getInputStream() method seems to return the encoded byte stream
instead of the decoded one.

Best regards,

Werner.


pgsql-jdbc by date:

Previous
From: Werner Donné
Date:
Subject: Re: DatabaseMetaData.getStringFunctions() reports "concat"
Next
From: Rob Stone
Date:
Subject: Connection Problem