File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
getInt() on a NULL value
Joined: Jan 08, 2002
Jul 26, 2002 09:59:00
I am using this code;
int myInt = myResultSet.getInt("myValue")
The problem is that I need to know if myValue is NULL in the database or if it is actually 0.
How is this done please?
Joined: Sep 07, 2000
Jul 26, 2002 23:28:00
You can use wasNull() method to check if the last column read had a value of SQL NULL. Before that call getInt() to read the value.
Snigdha<br />Sun Certified Programmer for the Java™ 2 Platform
I agree. Here's the link:
subject: getInt() on a NULL value
Reading from XML file
Define constants !
fgets and fscanf
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014