Peter Becker wrote:
> I have heard of (and from) many people involved in the development of 
> relational databases and/or the SQL standard who regret the introduction 
> of NULL. Codd wanted it replaced with two distinct values, Date called 
> them "a disaster". IIRC Jim Melton had some negative comments, too: 
> http://www.se-radio.net/podcast/2009-06/episode-137-sql-jim-melton -- it 
> has been a while that I listened to that episode.
>
> I don't think not only beginners would think of the following two 
> selects as equivalent, but they are not:
>
>   SELECT * FROM tableX;
>   SELECT * FROM tableX WHERE x<=5 OR x>5;
>   
That should come as no surprise to anyone who has used float or double 
and has NaN's in the data.

Now something that really strikes me as odd is that some databases and 
JDBC drivers go ape when you do

    preparedStatement.setDouble( bindIdx, doubleVar );

when doubleVar is NaN.

Instead you have to do

    preparedStatement.setNull( bindIdx, dataType, typeName );

in this case, whereas you'd expect that setDouble() should just do the 
right thing period.

Some JDBC drivers insist that you specify dataType even for trivial 
cases (whereas typeName only needs to be specified for STRUCT types, 
etc).  This is allowed by the spec, but is really quite silly 
considering the database knows the schema.  For even more fun, some 
databases/drivers will report the type of NCLOB columns as Types.OTHER 
and then throw an exception if you turn around and pass this as the 
dataType for setNull.  It's enough to drive one absolutely batty.

--
Jess Holle


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to javaposse@googlegroups.com
To unsubscribe from this group, send email to 
javaposse+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to