DXC Technology interview question

about java sql write code for prime no etc.