Many a times it may happen that if data is coming as a null from the database then in that case if we simply set those value into bean without any check then we will get null on our jsp pages.
So in order to avoid those situations you can check for the values that are coming from the database and if those values are null then you can make them as an empty string.
Please look at the below example to make it more clear.
if(resultSet.getString("EMAIL_ID")!=null && !("".equalsIgnoreCase(resultSet.getString("EMAIL_ID"))))
{
raiseTktDtlsBean.setEmailId(resultSet.getString("EMAIL_ID"));
}
else
{
raiseTktDtlsBean.setEmailId(resultSet.getString(""));
}
Here, In the above code as you can see that if the column named EMAIL_ID contains null value for that record then in that case we have set empty string in the bean for displaying on the web page.
Like this you can do for the all the columns which contains null value.
So in order to avoid those situations you can check for the values that are coming from the database and if those values are null then you can make them as an empty string.
Please look at the below example to make it more clear.
if(resultSet.getString("EMAIL_ID")!=null && !("".equalsIgnoreCase(resultSet.getString("EMAIL_ID"))))
{
raiseTktDtlsBean.setEmailId(resultSet.getString("EMAIL_ID"));
}
else
{
raiseTktDtlsBean.setEmailId(resultSet.getString(""));
}
Here, In the above code as you can see that if the column named EMAIL_ID contains null value for that record then in that case we have set empty string in the bean for displaying on the web page.
Like this you can do for the all the columns which contains null value.