modified sql to receive ejb