For getting record from database