Re: [INTERFACES] binary insert with JDBC

From: Sean Reilly <sreilly(at)cnri(dot)Reston(dot)Va(dot)US>
To: Peter Mount <peter(at)maidstone(dot)gov(dot)uk>
Cc: "'interfaces postgres'" <pgsql-interfaces(at)postgreSQL(dot)org>, "'Peter at home'" <peter(at)retep(dot)org(dot)uk>
Subject: Re: [INTERFACES] binary insert with JDBC
Date: 1998-05-13 22:08:27
Message-ID: 355A19DA.CB496923@cnri.reston.va.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hello,
Thanks for taking the time to reply =)

I'm using version 6.3.2. I just tried using blobs and it seems to
take an unusually long time to retrieve the blobs (after the record
has been retrieved). Since I know my data will be under 512 bytes,
is there any way I can store it directly in a field in the table so
I can avoid the extra lookup? If not, is there any way that I can
speed up the retrieval of the blob (insertion speed doesn't matter)?
I've already tried creating an index for the oid, but it didn't help
much.

Thanks,
Sean

Peter Mount wrote:
>
> Ok, which version of Postgres are you using?
>
> To use Blobs (Binary Large Objects) currently you need to use the oid type.
>
> Take a look at the example.blobtest and example.ImageViewer classes as these
> deal with Blobs.
>
> --
> Peter T Mount, peter(at)maidstone(dot)gov(dot)uk, peter(at)retep(dot)org(dot)uk
> Please note that this is from my works email. If you reply, please cc my
> home address.
>
> -----Original Message-----
> From: owner-pgsql-interfaces(at)hub(dot)org
> [mailto:owner-pgsql-interfaces(at)hub(dot)org]On Behalf Of Sean Reilly
> Sent: Monday, May 11, 1998 11:09 PM
> To: interfaces postgres
> Subject: [INTERFACES] binary insert with JDBC
>
> Can anyone tell me how to insert binary data into
> a postgres table using JDBC? What type field should I use?
> Most importantly, how do I create an SQL statement with
> binary data? I thought this could be done with a
> PreparedStatement and setBytes() but it doesn't seem to
> be implemented in postgres.PreparedStatement. Is there
> some way to encode the binary value into the SQL string
> (like hex encoding or something)?
>
> I looked through the docs but couldn't find anything
> related to this, but it seems like it might be a common
> problem.
>
> Thanks,
> Sean

--
Sean Reilly | Corporation for National Research Initiatives
Programmer | sreilly(at)cnri(dot)reston(dot)va(dot)us
703.620.8990 x275 | http://www.cnri.reston.va.us

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Afernand 1998-05-14 02:17:48 pgsql for W95
Previous Message Byron Nikolaidis 1998-05-13 15:09:05 Re: ANOTHER NEW ODBC DRIVER