Received: from pirania.dif.um.es (IDENT:root@pirania.dif.um.es [155.54.210.33]) by hub.org (8.10.1/8.10.1) with ESMTP id e95B1C785926 for ; Thu, 5 Oct 2000 07:01:12 -0400 (EDT) Received: from dif.um.es (IDENT:gabilm@pirania.dif.um.es [127.0.0.1]) by pirania.dif.um.es (8.9.3/8.9.3) with ESMTP id MAA03354 for ; Thu, 5 Oct 2000 12:59:56 +0200 Message-ID: <39DC5F29.E9F4023@dif.um.es> Date: Thu, 05 Oct 2000 12:59:53 +0200 From: Gabriel Lopez X-Mailer: Mozilla 4.72 [es] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: psql Subject: wrong documentation and others ..... Content-Type: multipart/alternative; boundary="------------9A3320E3184A86C706925506" X-Archive-Number: 200010/13 --------------9A3320E3184A86C706925506 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi all. I have several days working with LargeObject and postgres 7.0.2 and I have found many problems. In the first time the postgresql doc is wrong, in chapter 58 of PosgreSQL tutorial (JDBC Interfaces) it repot who to work with Large Object and give code that is wrong: File file = new File("myimage.gif"); FileInputStream fis = new FileInputStream(file); PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)"); ps.setString(1,file.getName()); ps.setBinaryStream(2,fis,file.length()); ps.executeUpdate(); ps.close(); fis.close(); PreparedStatement ps = con.prepareStatement("select oid from images where name=?"); ps.setString(1,"myimage.gif"); ResultSet rs = ps.executeQuery(); if(rs!=null) { while(rs.next()) { InputStream is = rs.getBinaryInputStream(1); // use the stream in some way here is.close(); } rs.close(); } ps.close(); InputStream ARE NOT SUPPORTED in JDBC implementation ¡¿?¡ and "getBinaryInputStream()" really is "getBinaryStream()". I think that it is very serious. The other method (that I know) is using LargeObjectAPI, but this fail every 9 times of PreparedStatement of setObject() sentence ¡¡¡ and when use LargeObjectManager as in source examples. (I send other messages to list) Has PostgreSQL any way to work WELL with LargeObject.? Please reply me. Cheers, Gabi. -- Gabriel López Millán Facultad de Informática -Universidad de Murcia 30001 Murcia - España (Spain) Telf: +34-968-364644 E-mail: gabilm@dif.um.es --------------9A3320E3184A86C706925506 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit  

    Hi all.

    I have several days working with LargeObject and postgres 7.0.2 and I have found many problems. In the first time the postgresql doc is wrong, in chapter 58 of PosgreSQL tutorial (JDBC Interfaces) it repot who to work with Large Object and give code that is wrong:

        File file = new File("myimage.gif");
        FileInputStream fis = new FileInputStream(file);
        PreparedStatement ps = conn.prepareStatement("insert into images values (?,?)");
        ps.setString(1,file.getName());
        ps.setBinaryStream(2,fis,file.length());
        ps.executeUpdate();
        ps.close();
        fis.close();

        PreparedStatement ps = con.prepareStatement("select oid from images where name=?");
        ps.setString(1,"myimage.gif");
        ResultSet rs = ps.executeQuery();
        if(rs!=null) {
            while(rs.next()) {
                InputStream is = rs.getBinaryInputStream(1);
                // use the stream in some way here
                is.close();
                }
            rs.close();
        }
        ps.close();
 

        InputStream ARE NOT SUPPORTED in JDBC implementation ¡¿?¡ and "getBinaryInputStream()" really is "getBinaryStream()".  I think that it is very serious. The other method (that I know) is using LargeObjectAPI, but this fail every 9 times of PreparedStatement of setObject() sentence ¡¡¡ and when use LargeObjectManager as in source examples. (I send other messages to list)
 

        Has PostgreSQL any way to work WELL with LargeObject.?

    Please reply me.

    Cheers, Gabi.
 

-- 
Gabriel López Millán    
Facultad de Informática -Universidad de Murcia
30001 Murcia - España (Spain)
Telf: +34-968-364644 E-mail: gabilm@dif.um.es
  --------------9A3320E3184A86C706925506--