Hi Brian,

At 07:03 AM 10/8/2001, you wrote:
>>I am trying to insert and/or select from Postgres a gif image by using
>>the Large Object type. ...
>>The first statement [ps.setBinaryStream(2,fis, file.length())] produces a 
>>compile time error :
>>main.java:70: setBinaryStream(int,java.io.InputStream,int) in
>>java.sql.PreparedStatement cannot be applied to
>>   ps.setBinaryStream(2,fis, file.length());
>>The JDBC API confuses me a little.  Why doesn't the JDBC interface
>>define a long for this argument?  After all, we are dealing with big
>>byte streams.  Hmm.

I don't know, but that's a JDBC issue. Have you tried simply casting the 
long to an int? I'm using the same code as you and it works. The next 
problem you're sure to encounter is an invalid OID value (0). This is 
caused by trying to access large objects outside of a transaction. I assume 
you aren't using transactions since I don't see a "conn.commit()" after the 
executeUpdate() call.

>>Maybe I have an old version of your driver.

Yes indeed. 7.1 is the latest stable release driver, and 7.2 is in development.


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?


Reply via email to