You should check to make sure the input string is valid, and further, within your code you need to include checks for invalid input data. The relevant part of the exception is this: java.lang.NumberFormatException: For input string: ""
I can't tell from the script itself, because I don't know the exact line numbers in your code, but one of the parseInt calls in the lines below is receiving an empty string (""
) instead of a valid number input:
s.setPrimaryProviderId(Integer.parseInt(row[11]));
s.setSecondaryProviderId(Integer.parseInt(row[13]));
s.setTertiaryProviderId(Integer.parseInt(row[15]));
You should include checks like this:
if(!"".equals(row[11])){ //If row[11] is not an empty string
s.setPrimaryProviderId(Integer.parseInt(row[11]));
}
else{
// Handle the case where this part of the data is empty
}
You should also include these check with the parseDouble lines as well.