jguy
asked on
JDBC and NaN in where condition
I try to retrieve rows that include columns with an NaN value as Float.
I use preparedStatement.
ex : select c1,c2,c3 where c1 = ?
java code is like :
ps = con.preparedStatement(sele ct c1,c2,c3 where c1 = ?);
ps.setObjet(1,new Float(Float.NaN);
rs = ps.executeQuery();
I know that some rows match this case, but rs.next() return false
Can somebody help me ?
I use preparedStatement.
ex : select c1,c2,c3 where c1 = ?
java code is like :
ps = con.preparedStatement(sele
ps.setObjet(1,new Float(Float.NaN);
rs = ps.executeQuery();
I know that some rows match this case, but rs.next() return false
Can somebody help me ?
ASKER
I tried this solution yet with no succes. In fact, i think it is probably due to the bite value of the Float.NaN in java comparing to the his value on the database (I use Sybase).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Something like ps.setFloat(1,Float.NaN);
And besides that have you checked your SQL statement ?? YOu have forgotten your erm.. Table name .