JDBC and BLOB in Postgres

From: Didier Boudigue <didier(dot)boudigue(at)nextenso(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org, pgsql-interfaces(at)hub(dot)org
Subject: JDBC and BLOB in Postgres
Date: 2000-10-06 12:27:39
Message-ID: 39DDC53B.DC22F0BE@nextenso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Hi,

I'm trying Blob with JDBC Driver jdbc7.0-1.2 on postgresql 7.0.2
(Mandrake 7.1) follwing the example given in paragraph "Using Large
Objects" Chapter 58. JDBC Interface.

the getBinaryStream seems ok provided the blob is in the database,
while the setBinaryStream method call returns :

Error : InputStream as parameter not supported

Did I miss something ?

Thanks in advance.

The Code I'm using:

File file = new File("Blob.class");
FileInputStream fis = new FileInputStream(file);
cx.setAutoCommit(false);
ps = cx.prepareStatement("insert into mytable (myid, myblob) values (1,
?)");
ps.setBinaryStream(1, fis, (int) file.length());
ps.executeUpdate();
ps.close();
fis.close();
cx.commit();



Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ned Lilly 2000-10-06 17:35:04 Re: Who do I forward questions to?
Previous Message Gabriel Lopez 2000-10-06 11:51:26 Re: wrong documentation and others .....