updateBlob()-example?

Поиск
Список
Период
Сортировка
От Guido Fiala
Тема updateBlob()-example?
Дата
Msg-id 200402120924.10554.guido.fiala@dka-gmbh.de
обсуждение исходный текст
Ответы Re: updateBlob()-example?
Список pgsql-jdbc
Hallo together,

maybe someone can help - i can get updateBlob() working and i couldn't find
any working example so far.

ResultSet rs...
Blob b=getBlob(1);

works just fine, but how do i store a modified value in the database?

I tried:

bytes[] bt=...;//something binary

Blob newblob=new Blob(); //does not work, Blob is not instanciateable

//writing the "Blobs" data as byte[]-Array using

rs.updateBytes(1, bt);

//fails because it modifies the contents of the byte[], or maybe i don't
//understand what this function can be used for.

Blob b=rs.getBlob(1);

// throws null-pointer for insertRow and "wrong format for integer" for
// updateRow, although row "1" is definitely an varchar-column

b.setBytes(0,bt); //could not test because of above
rs.updateBlob(b);// dito

What is the right (and efficient) way to do this?

Guido

remark: as the large-object table is named to be a "potential security leak"
as all user have the right to read from it, i like to store values for
(middle sized) objects directly in my tables.


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: closing statements when connection is closed
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: updateBlob()-example?