Detect null value in database
How to detect null value in a database field and how to handle the error? Whenever I use a getDate() method to access a blank date field, there will be error in the console and no response in the program.
[218 byte] By [
hanxue] at [2007-9-26 2:36:38]

most of the RDBMS having that function,i have used for oracle,sql server. what DB u are using? Try to execute the query in sql mode and then replace in ur code
b_babu at 2007-6-29 10:04:42 >

Hi,
At the jdk 1.3 docs you can see : getDate() returns null
if the column is SQL null so you can test if your var refers
null before use it :
some_date=rs.getDate(1);
if(some_date == null) -> do some action
else -> proceed norm
The sol via funct. nvl is dependend of Database (ex. in Oracle Rdb not exist) and I think is a "bad solution"
Bye