wasNull() syntax

From: Henry (greenclay_at_optonline.net)
Date: 03/27/04


Date: Fri, 26 Mar 2004 23:35:11 GMT

I need some help with the syntax for properly calling the wasNull()
function in JSP. (I'm using Win2K and Tomcat 5.0.19 with Oracle 8.1.5
and Mozilla 1.6 )

I have a table in which some records for a column may be null. It is a
string datatype. I'm calling a stored procedure which returns a
ResultSet. While iterating through the ResultSet, I want to test this
column for null values so I can print several dashes "---" instead of
"null." At the moment, I'm doing it like this:

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

  while (objRecordSet.next()) {

    // ...

    if (objRecordSet.getString("exer_time").wasNull())
       out.println("<TD align='right'><FONT SIZE='-1' +
       name='Arial'>" + " --- " + "</FONT></TD>");
    else
       out.println("<TD align='right'><FONT SIZE='-1' +
       name='Arial'>" + objRecordSet.getString("exer_time") +
       "</FONT></TD>");

    \\ ...

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

This fails. The error message in the browser is "cannot resolve
symbol." I'm not at all sure that I'm using the function correctly, or
even, given the way my stored procedure is written, as the Java help
merely describes the function but provides no example; it says:

      " Retrieves whether the last OUT parameter read had the value of
        SQL NULL."

The stored procedure I'm using does not use an OUT parameter, however:

PACKAGE SPEC
------------

FUNCTION getPushupRecs RETURN pushupResultSet;

PACKAGE BODY
------------

FUNCTION getPushupRecs RETURN pushupResultSet
IS

    pushup_cursor pushupResultSet;

BEGIN

    OPEN pushup_cursor FOR
    SELECT *
    FROM pushups
    ORDER BY exer_date, set_num;

    RETURN pushup_cursor;

END;

I'd be grateful if someone could point me in the right direction.

Henry