Maciej Jaźwiński wrote:
> I have a problem with varbit and blobs. I need to upload binary files to
> my database, and yesterday I've got it working.... for an hour or two.
> Files were uploaded, but image (which I tried to download then was
> corrupted). But the worst came later, postgres started to throw
> exceptions at me :( Help, this is part of my diploma, and i really need
> to get it working..
> org.postgresql.util.PSQLException: ERROR: "%" is not a valid binary digit
> String update = "insert into resources (resources_id, projects_id,
> requirements_id, " +
> "filename, content_type, filesize, file) values (?, ?, ?, ?, ?, ?, ?)";
What is the definition of the 'resources' table?
I suspect from your description and the error that you are getting
confused between bit(n) (bit string) and bytea (binary data). For your
application it sounds like you want to use bytea. There's no direct
mapping of bit(n) types in JDBC.
See http://www.postgresql.org/docs/8.0/static/datatype-binary.html and
In response to
pgsql-jdbc by date
|Next:||From: Kris Jurka||Date: 2005-08-22 06:07:26|
|Subject: Re: Czech translation|
|Previous:||From: Petr Dittrich||Date: 2005-08-21 19:12:41|
|Subject: Czech translation|