A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Today (12/10) is CodeRanch Day in
Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
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
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-2013