Trying to read records from database but nullpointerexception always occurs. At this point I have not figured out what is null.