About Postgres Large Object

From: root <virender(at)magnum(dot)barc(dot)ernet(dot)in>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: About Postgres Large Object
Date: 2004-01-27 06:49:28
Message-ID: 401609F8.E94E3199@magnum.barc.ernet.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2004-01-27 07:20:31 Re: Patch to readd documentation
Previous Message Oliver Jowett 2004-01-27 04:02:58 Re: Patch to readd documentation