| Author |
Null Pointer exception despite using Float
|
Vic Hood
Ranch Hand
Joined: Jan 05, 2011
Posts: 477
|
|
Hi All ,
Im trying to insert null values into a database for a particular column , if there has been no entry into a field .
I'm using a bean to carry my data around .
fmotorrating is defined as
Any pointers as to why this could be happening?
|
Learning and Learning!-- Java all the way!
|
 |
Harsha Smith
Ranch Hand
Joined: Jul 18, 2011
Posts: 287
|
|
.equals or == null?
Line 2
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
|
Are you sure you get exception at stmt.setNull(8, Types.FLOAT); ? because even I doubt that how the if statement is succeed?
|
 |
lokesh pattajoshi
Ranch Hand
Joined: Jul 29, 2009
Posts: 130
|
|
Hi,
If is returning null than in that line only you will get Null Pointer Exception as you can't use dot operator on null.
Instead of you can use
Regards,
Lokesh
|
 |
Vic Hood
Ranch Hand
Joined: Jan 05, 2011
Posts: 477
|
|
Hi All I tried that , earlier it wasnt working however now its working . Weird .
Thank you for your help . All!
|
 |
 |
|
|
subject: Null Pointer exception despite using Float
|
|
|