Storing BLOB from other machine

Поиск
Список
Период
Сортировка
От S.A.Pamungkas
Тема Storing BLOB from other machine
Дата
Msg-id 20001213040048.13887.qmail@web4904.mail.yahoo.com
обсуждение исходный текст
Список pgsql-interfaces
I need to create a user interface that used to store
blob from other machine (internet).
My user interface is working good to store BLOB from
local machine (using large object API). BLOB retrieval
is also o.k from both local and remote machine.

I know that to store BLOB from remote machine, I
should use fastpath API. The problem is: I din't know
how to use fastpath API ? 

In which step the fastpath API should be added, if the
sceleton code that I used to store BLOB is as follow:
.....
class importer extends Thread
{  String code;  String filename;   /* filename is the file (path) for blob that will
be stored to database, for example 
/usr/local/image/image.jpg */
  Connection con;
  public importer(Connection con, String code, String
filename){    this.con = con;    this.code = code;    this.filename = filename;  }  public void run(){   if (code!=null
&&filename!=null){     Statement stat = null;          try{        LargeObjectManager
 
lom=((org.postgresql.Connection).getLargeObjectAPI();        con.setAutoCommit(false)        byte buf[] = new
byte[3000];       FileInputStream fis= new FileInputStream(new
 
File(fileOid));        int oid = lom.create();        LargeObject blob = lom.open(oid);                int s, t=0;
 while((s=fis.read(buf,0,buf.length))>0){          t += s;          blob.write(buf,0,s);         }        ......
 
Thank you.

S.A.Pamungkas      








__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/


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

Предыдущее
От: Bob Kline
Дата:
Сообщение: Re: your mail
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: JDBC, Timestamp and getting microseconds