Skip site navigation (1) Skip section navigation (2)

downloading image blobs

From: Matt Fair <matt(at)netasol(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: downloading image blobs
Date: 2001-09-25 16:21:28
Message-ID: 3BB0AF08.1080304@netasol.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hello,
I am having a similary problem that I was having when I was trying to 
upload an image to the database. I am already able to upload blobs into 
the database but I cannot download them.
I get the error 'inv_open: large object 12992 not found', which I assume 
means that the statement should be in a transaction, but it is and it 
still outputs the error.
Here is my code:
        con.setAutoCommit(false);
        Statement statement = con.createStatement();
        ResultSet rs = statement.executeQuery("select image from 
userpreferences where username='"+user+"'");
        if(rs == null) return null;
        rs.next();
        InputStream is = rs.getBinaryStream("image");     <----- This is 
where the error is thrown
        JimiReader reader = Jimi.createJimiReader(is);
        image = reader.getImage();
        con.commit();
        con.close();
        return new ServerMessage(new JimiImageSerializer(image));
Here is my error stack trace:
FastPath call returned ERROR:  inv_open: large object 12992 not found

        at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:126)
        at org.postgresql.fastpath.Fastpath.fastpath(Fastpath.java:176)
        at org.postgresql.fastpath.Fastpath.getInteger(Fastpath.java:188)
        at 
org.postgresql.largeobject.LargeObject.<init>(LargeObject.java:89)
        at 
org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:134)
        at 
org.postgresql.jdbc2.ResultSet.getBinaryStream(ResultSet.java:437)
        at 
org.postgresql.jdbc2.ResultSet.getBinaryStream(ResultSet.java:544)
        at 
org.opensimpx.server.RequestHandler.getBackgroundImage(RequestHandler.java:688)
        at 
org.opensimpx.server.RequestHandler.handleRequest(RequestHandler.java:440)
        at org.opensimpx.server.RequestHandler.run(RequestHandler.java:221)
        at java.lang.Thread.run(Thread.java:479)

Any ideas?
Thank you in advanced,
Matt


Responses

pgsql-jdbc by date

Next:From: chris markiewiczDate: 2001-09-25 16:44:25
Subject: Re: downloading image blobs
Previous:From: Liam StewartDate: 2001-09-25 14:10:59
Subject: fix for JDBC test suite

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group