Re: Please help with binary file - Mailing list pgsql-jdbc

From Fernando Nasser
Subject Re: Please help with binary file
Date
Msg-id 3F02D70D.5070604@redhat.com
Whole thread Raw
In response to Please help with binary file  ("Akash Shah" <akash.s@ap.sony.com>)
Responses Re: Please help with binary file  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Paul Thomas wrote:
>
> On 02/07/2003 06:38 Akash Shah wrote:
>
>> Hi ,
>>
>> I am trying to upload binary file to the PostgreSQL 7.3.2 with JDBC3
>> driver
>> supplied by postgresql (pg73jdbc3). The table to which I am trying to
>> save
>> the file has a field of OID datatype. And while doing so I get
>>
>> "java.sql.SQLException: ERROR: oidin.............."  error.
>>
>> I tried changing OID data type to bytea. After that code worked and I
>> tried
>> file sizes from 4KB to1.6 MB. If file size is larger than that ( even for
>> a
>> 10 MB size file ) execution just gets stuck. No error,  no exception
>> thrown.
>
>
> Reaed the docs (5.6 Storing Binary Data). They give sample code of how
> to use Large Objects with JDBC. I think this will do what you want.
>

And don't use bytea until 7.4, when the new V3 protocol is on unless you
have real security issues with other people being able to read your LOB
(PostgreSQL LO facility is not secure while bytea is).

You would need a patch to use bytea with 7.3 but it is not an ideal
solution so you should avoid it (it has not been incorporated to the
sources so you would have to get into the business of building the
driver yourself).



--
Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9


pgsql-jdbc by date:

Previous
From: Paul Thomas
Date:
Subject: Re: Please help with binary file
Next
From: "scott.marlowe"
Date:
Subject: Re: db