How to deal with "oid" field when it contains NULL ?

From: "RaviShankar K" <ravi(at)e-jan(dot)co(dot)jp>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: How to deal with "oid" field when it contains NULL ?
Date: 2001-08-09 08:25:37
Message-ID: 02d101c120ac$de66fe40$0400a8c0@ejan.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi,

I am retrieving value of "oid" field using "getBlob(columnName)" method
of ResultSet .
It is working fine if that field contains some "oid" reference . But if the
field contains
NULL , then it is throwing following error .

"FastPath call returned ERROR: inv_open: large object 0 not found"

I am able to solve the problem using the following way .

ResultSet rs ;
//If the value of reference is 0 , then there is no Blob value in the
row for the column "columnX".
if(rs.getInt("columnX") != 0){
Blob someBlob = rs.getBlob("columnX");
}

Is there any better way than this ?
Thanks in advance.

Regards,
Ravi

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message RaviShankar K 2001-08-09 08:28:34 Retrieving field of type bigint[]
Previous Message Rene Pijlman 2001-08-09 08:17:33 Re: Re: JDBC 2.0 conformance, documentation and todo list