Thread: BLOB Type ?

BLOB Type ?

From
Thorsten Mauch
Date:
Hi All
I wand to save pictures in the database.
But i didn't found blob type ?
My client is a JDBC-Application.
What must i do, in order to save pictures to
the database

THanx
Thorsten



Re: BLOB Type ?

From
Ryan Ho
Date:
I don't know much about JDBC but as far as postgres is concerned, it does
not store blobs in regular tables. Instead, you need to import the blob
into the database, obtain the OID (something like a pointer to the blob,
it's an integer), and store the OID in the regular table. Although u can
use psql to import blobs, most application's drivers should provide a
function to import the blob. For example, pg_loimport in PHP. pg_loimport
returns the OID of the blob, which is then inserted into a table.


Thorsten Mauch wrote:

> Hi All
> I wand to save pictures in the database.
> But i didn't found blob type ?
> My client is a JDBC-Application.
> What must i do, in order to save pictures to
> the database
>
> THanx
> Thorsten
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: BLOB Type ?

From
Ryan Ho
Date:
I don't know much about JDBC but as far as postgres is concerned, it does
not store blobs in regular tables. Instead, you need to import the blob
into the database, obtain the OID (something like a pointer to the blob,
it's an integer), and store the OID in the regular table. Although u can
use psql to import blobs, most application's drivers should provide a
function to import the blob. For example, pg_loimport in PHP. pg_loimport
returns the OID of the blob, which is then inserted into a table.

Thorsten Mauch wrote:

> Hi All
> I wand to save pictures in the database.
> But i didn't found blob type ?
> My client is a JDBC-Application.
> What must i do, in order to save pictures to
> the database
>
> THanx
> Thorsten
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


Re: BLOB Type ?

From
Steve Waldman
Date:
I'm not sure if thigs have changed in 7.1, but in 7.0,
as others have said, just use the type OID for
your BLOB / long binary fields.

The JDBC side is very easy. Just use ResultSet.getBytes()
and PreparedStatements.setBytes() to get and set values.

     hope this helps,
       Steve


On Sat, Apr 21, 2001 at 10:48:30PM +0200, Thorsten Mauch wrote:
> Hi All
> I wand to save pictures in the database.
> But i didn't found blob type ?
> My client is a JDBC-Application.
> What must i do, in order to save pictures to
> the database
>
> THanx
> Thorsten
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)