• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 352
  • Last Modified:

java numberformat exception

i have a billingdetailid as an Integer field.

Now this has no value when called from database so billingdetails.getbillingdetailid is null.

Now when i do
 String billingDetailId = (request.getParameter("billingDetailId"));
it throws the following error.

java.lang.NumberFormatException: For input string: "null"

Please tell  me how can i rectify it.

1 Solution
zzynxSoftware engineerCommented:
Can you show us the method getParameter() used in

I guess you have something like Integer.parseInt(string_param) somewhere. This type of method requires a number as string_param and null is not. You need to fix the problem so the paramter is not null there either by checking that it is not null:
if !(string_param == null){
    //do whatever necessary to handle null

Or you could make sure that the DB doesn't return null
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now