A select query is executed to fetch record having the same login id and type from the table LOGIN. Make sure that when you are running your project for the first .