You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Graeme J Sweeney <ib...@gjsweeney.com> on 2008/02/15 16:35:48 UTC

Re: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationExc eption

On Fri, 15 Feb 2008, erosik wrote:

>     i am using ibatis in my jsp application, i have created db with a
> unique field (e.g. id) so when i insert a record with same id again  i m
> getting error like this, can any one help to sort out this exception
>
> com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException:
> Duplicate
> entry '123' for key 1

Sort out how?

If you have more than one 'id' with value '123' then you cannot use the 
unique constraint. You need to alter the schema of the database to remove 
it.

-- 
Graeme -