You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Unai Vivi (JIRA)" <ji...@apache.org> on 2013/01/07 18:32:18 UTC

[jira] [Updated] (DERBY-6037) ResultSet.getString() doesn't return null on SQL NULL columns

     [ https://issues.apache.org/jira/browse/DERBY-6037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Unai Vivi updated DERBY-6037:
-----------------------------

       Priority: Minor  (was: Major)
    Description: 
ResultSet.getString() doesn't return null on SQL NULL columns of type VARCHAR; it returns the string "null" instead.
I tried derby versions 10.8.2.2 and 10.9.1.0 (derby.jar - embedded) and both show the same behaviour.

ResultSet javadocs state that the returned value shall be "the column value; if the value is SQL NULL, the value returned is null" (null, not the String containing n-u-l-l of .length() 4).

I'm not sure if this bug report belongs here or on Oracle's ResultSet implementation.


  was:
ResultSet.wasNull() returns false after a ResultSet.getString("COLUMNNAME") on a null VARCHAR field.
I tried derby versions 10.8.2.2 and 10.9.1.0 (derby.jar - embedded) and both show the same behaviour.

E.g.
<pre>

        ResultSet rs = null;
        //[...]
            rs = s.executeQuery("select EXAMPLE_PK,BLAHBLAH,COLUMN from MYTABLE order by EXAMPLE_PK desc");
            while (rs.next())
            {
                //[...]
                String myStr = rs.getString("COLUMN");//all rows have SQL null for field COLUMN
                if (rs.wasNull())
                {//never gets here
                    //[...]
                }
//[...]

</pre>

        Urgency: Low  (was: Normal)
        Summary: ResultSet.getString() doesn't return null on SQL NULL columns  (was: ResultSet.wasNull() returns false for null VARCHAR columns)
    
> ResultSet.getString() doesn't return null on SQL NULL columns
> -------------------------------------------------------------
>
>                 Key: DERBY-6037
>                 URL: https://issues.apache.org/jira/browse/DERBY-6037
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, SQL
>    Affects Versions: 10.8.2.2, 10.9.1.0
>         Environment: Java 7u7
>            Reporter: Unai Vivi
>            Priority: Minor
>
> ResultSet.getString() doesn't return null on SQL NULL columns of type VARCHAR; it returns the string "null" instead.
> I tried derby versions 10.8.2.2 and 10.9.1.0 (derby.jar - embedded) and both show the same behaviour.
> ResultSet javadocs state that the returned value shall be "the column value; if the value is SQL NULL, the value returned is null" (null, not the String containing n-u-l-l of .length() 4).
> I'm not sure if this bug report belongs here or on Oracle's ResultSet implementation.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira