Обсуждение: jdbc large object support ??

Поиск
Список
Период
Сортировка

jdbc large object support ??

От
John Thorhauer
Дата:
I read on the jdbc driver web page that "Stream support for large
objects is delayed until 7.1".  But I also see an example called
ImageViewer.java in the src distribution of postgres that uses large
objects.  So...... Can I use postgres large objects with the most recent
jdbc driver? Anf if so, what is "Stream support" and do I really need
it?

Thanks,
John
-- 
********************************
** John Thorhauer
** jthorhauer@phoenixcolor.com
********************************


Re: jdbc large object support ??

От
Joachim Achtzehnter
Дата:
On Wed, 19 Jul 2000, John Thorhauer wrote:
>
> I read on the jdbc driver web page that "Stream support for large
> objects is delayed until 7.1".  But I also see an example called
> ImageViewer.java in the src distribution of postgres that uses large
> objects.  So...... Can I use postgres large objects with the most recent
> jdbc driver? Anf if so, what is "Stream support" and do I really need
> it?

Take a look at the mailing list archive. This question was discussed in
great detail during the last couple of days. You use setBytes() and
getBytes() instead of streams, for details see the archive.

Joachim



Re: jdbc large object support ??

От
John Thorhauer
Дата:
Joachim Achtzehnter wrote:
> 
> Take a look at the mailing list archive. This question was discussed in
> great detail during the last couple of days. You use setBytes() and
> getBytes() instead of streams, for details see the archive.
> 

OK.  I looked at that and I saw someone mention something about using
the text type to store data.  What I am doing is trying to store xml
files in postgres.  So maybe a field of type "text" willl take care of
my needs.  What is the size limit on fields of type text?

Thanks,
John
-- 
********************************
** John Thorhauer
** jthorhauer@phoenixcolor.com
********************************


Re: jdbc large object support ??

От
Joachim Achtzehnter
Дата:
On Wed, 19 Jul 2000, John Thorhauer wrote:
>
> Joachim Achtzehnter wrote:
> >
> > Take a look at the mailing list archive. This question was discussed in
> > great detail during the last couple of days. You use setBytes() and
> > getBytes() instead of streams, for details see the archive.
> >
>
> OK.  I looked at that and I saw someone mention something about using
> the text type to store data.  What I am doing is trying to store xml
> files in postgres.

Was not referring to the use of the text type, but rather to the lengthy
discussion about how one can use Postgresql large objects via JDBC. Just
read all of yesterday's messages with "setBytes" or "Blob" in the subject
line. This was all about large object (BLOB) support.

Joachim




Re: jdbc large object support ??

От
"S.A.Pamungkas"
Дата:
--- Joachim Achtzehnter <joachim@kraut.bc.ca> wrote:

> ..... This was all about large object (BLOB)
> support.

Is the Postgresql large object (BLOB) support
including "video file" also ( MPEG, ram etc ) ???

- Pamungkas-

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail � Free email you can access from anywhere!
http://mail.yahoo.com/


Re: jdbc large object support ??

От
Joachim Achtzehnter
Дата:
Today, in a message to pgsql-interfaces, S.A.Pamungkas wrote:
> 
> Is the Postgresql large object (BLOB) support
> including "video file" also ( MPEG, ram etc ) ???

A BLOB (Binary Large OBject) is a sequence of bytes. Postgresql does not
know or care what these bytes mean. Sure, you can store MPEG files if you
like.

Joachim

-- 
work:     joachima@realtimeint.com (http://www.realtimeint.com)
private:  joachim@kraut.bc.ca      (http://www.kraut.bc.ca)



RE: jdbc large object support ??

От
Peter Mount
Дата:
Large Objects have been supported for years - just not via streams.

Stream support is simply passing an InputStream (say from a file) directly
to a large object in the database. The ImageViewer example shows the other
two ways, using setBytes() and using our own extensions.

Peter

--
Peter Mount
Enterprise Support Mushroom
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council


-----Original Message-----
From: John Thorhauer [mailto:jthorhauer@phoenixcolor.com]
Sent: Wednesday, July 19, 2000 9:07 PM
To: postgres-inter
Subject: [INTERFACES] jdbc large object support ??


I read on the jdbc driver web page that "Stream support for large
objects is delayed until 7.1".  But I also see an example called
ImageViewer.java in the src distribution of postgres that uses large
objects.  So...... Can I use postgres large objects with the most recent
jdbc driver? Anf if so, what is "Stream support" and do I really need
it?

Thanks,
John
-- 
********************************
** John Thorhauer
** jthorhauer@phoenixcolor.com
********************************


Re: jdbc large object support ??

От
John Thorhauer
Дата:
Peter Mount wrote:
> 
> Large Objects have been supported for years - just not via streams.
> 
> Stream support is simply passing an InputStream (say from a file) directly
> to a large object in the database. The ImageViewer example shows the other
> two ways, using setBytes() and using our own extensions.

I tried the setBytes method and it worked great!  Thanks for the help.
However, I have another question.  If I understand correctly I can use
the setBytes() method or the getLargeObjectAPI() method.  Is one
preferred over the other?  Does either have any distinct problems that I
should be aware of?

I know these are real general questions but I am trying to make sure
that I start off going in the right direction with this stuff ;-)

Thanks again,
John
-- 
********************************
** John Thorhauer
** jthorhauer@phoenixcolor.com
********************************


RE: jdbc large object support ??

От
Peter Mount
Дата:
The LargeObject & LargeObjectManager classes implement the actual interface
to the large objects. setBytes() actually uses those classes, so in theory
using the LargeObject classes would be the better.

However, setBytes() is part of the standard JDBC api.

Personally I prefer the extension classes, as you gain random access to the
BLOB.

Peter

--
Peter Mount
Enterprise Support Mushroom
Maidstone Borough Council
Any views stated are my own, and not those of Maidstone Borough Council


-----Original Message-----
From: John Thorhauer [mailto:jthorhauer@phoenixcolor.com]
Sent: Thursday, July 20, 2000 12:08 PM
To: postgres-inter
Subject: Re: [INTERFACES] jdbc large object support ??


Peter Mount wrote:
> 
> Large Objects have been supported for years - just not via streams.
> 
> Stream support is simply passing an InputStream (say from a file) directly
> to a large object in the database. The ImageViewer example shows the other
> two ways, using setBytes() and using our own extensions.

I tried the setBytes method and it worked great!  Thanks for the help.
However, I have another question.  If I understand correctly I can use
the setBytes() method or the getLargeObjectAPI() method.  Is one
preferred over the other?  Does either have any distinct problems that I
should be aware of?

I know these are real general questions but I am trying to make sure
that I start off going in the right direction with this stuff ;-)

Thanks again,
John
-- 
********************************
** John Thorhauer
** jthorhauer@phoenixcolor.com
********************************