Bug #27442 | ResultSet.wasnull method returns false for even null Blob field in DB | ||
---|---|---|---|
Submitted: | 26 Mar 2007 13:10 | Modified: | 26 Mar 2007 13:17 |
Reporter: | tarik karaoglu | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 3.1.14 | OS: | Windows (Windows XP Pro + SP2) |
Assigned to: | CPU Architecture: | Any | |
Tags: | java.sql.Blob, ResultSet, wasNull method |
[26 Mar 2007 13:10]
tarik karaoglu
[26 Mar 2007 13:17]
Mark Matthews
You have the order of the calls wrong. You can't call .wasNull() until _after_ you try and retrieve the value (and thus it doesn't make much sense to use it for ResultSet accessors that return object instances, since you can just do the normal "== null" check. From the apidocs: "Reports whether the last column read had a value of SQL NULL. Note that you must first call one of the getter methods on a column to try to read its value and then call the method wasNull to see if the value read was SQL NULL. "