Because rs.getInt("EMP_ID") was searching for column name EMP_IDin "select ID, NAME from EMPLOYEE where ID=?" while there was no such column name (neither in database nor as any alias name in query). (searching was done with invalid column name)