About Postgres Large Object - Mailing list pgsql-jdbc

From root
Subject About Postgres Large Object
Date
Msg-id 401609F8.E94E3199@magnum.barc.ernet.in
Whole thread Raw
Responses Re: About Postgres Large Object
List pgsql-jdbc
Hi ,
I am using postgresql 7.1.3 and Redhat 7.3
I am running this servlet given below.  But it is not running

//Retrieving the image from the database:
 // All LargeObject API calls must be within a transaction
 con.setAutoCommit(false);

 // Get the Large Object Manager to perform operations with
 LargeObjectManager lobj =
    ((org.postgresql.Connection)con).getLargeObjectAPI();

 PreparedStatement pstmt =
    con.prepareStatement("SELECT img FROM images WHERE imgname=?");
 pstmt.setString(1, "myimage.gif");
 ResultSet rs = pstmt.executeQuery();

 if (rs != null) {
    while(rs.next()) {
       // open the large object for reading
       int oid = rs.getInt(1);
       LargeObject obj = lobj.open(oid, LargeObjectManager.READ);

       // read the data
       byte buf[] = new byte[obj.size()];
       obj.read(buf, 0, obj.size());

       // do something with the data read here

       // Close the object
       obj.close();
    }
    rs.close();
 }
 pstmt.close();



Error  message is given below



[27/01/2004 10:19:43:138 IST] java.lang.NoSuchMethodError:
org.postgresql.largeo
bject.LargeObject.read([BII)V
        at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:
323)
        at
org.apache.jserv.JServConnection.run(JServConnection.java:188)
        at java.lang.Thread.run(Thread.java:536)


pgsql-jdbc by date:

Previous
From: "Thomas Hallgren"
Date:
Subject: Pl/Java 1.0.0.b now avaiable on Linux 386 and Cygwin
Next
From: "Derek Dilts"
Date:
Subject: CallableStatement support?