db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Meyer <meyer...@gmail.com>
Subject inserting missing values
Date Tue, 14 Dec 2010 19:45:31 GMT
What is the best way to handle missing values. For example, suppose I have
an array that I want to insert into a table, like double[] row = {1.0, 2.0,
MISSING,  4.0} where MISSING indicates a value that is missing. (I realize
this is not a valid double value). I have been using a prepared statement to
set a null value anytime I have missing data like, pstmt.setNull(i+1,
Types.DOUBLE); However, the problem is that using rs.getDouble(3) returns a
value of zero instead of null. The problem is that zero is a legitimate
double value, not a missing or null value. Is it better to inset data using
Double.NAN like pstmt.setDouble(i+1, Double.NaN);? What is the best way to
handle missing data?

Thanks

Mime
View raw message