If len1 is null then it means that rs.getBlob("Image"); is returning null. Is that what you get if the database column is empty? I'm not sure about that.
Well, if some of the column values are null, then, yeah, you're going to get an NPE when trying to dereference a null. Your code need to be prepared to deal with null values.
And, surely you can come up with better variable names than len1 and len21?
4-5 indexes are NULL, but after that indexes contains images, so why it gives NullPointerException? and I tried to remove NULL values by run the queries but it did not remove NULL values what should I do in that case?
1)DELETE FROM extra WHERE Image = "NULL";
2)ALTER TABLE extra ALTER COLUMN Image DROP DEFAULT;
If it is a valid use case that the 'Image' column can contain null, then you need to handle that possibility in your code. For example:
If the presence of null in the 'Image' column is considered a data integrity error then removing those rows is the right thing to do. The SQL for that would be: