Bookmark Topic Watch Topic
  • New Topic

java.sql.SQLException: Invalid argument value: Duplicate entry '3' for key 1  RSS feed

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi, i am getting following error
I am using mysql database


<code>
java.sql.SQLException: Invalid argument value: Duplicate entry '3' for key 1
</code>







ts_user CREATE TABLE `ts_user` (
`user_id` int(11) NOT NULL auto_increment,
`ref_company_id` int(11) default NULL,
`email` varchar(50) default NULL,
`password` varchar(10) default NULL,
`name` varchar(25) default NULL,
PRIMARY KEY (`user_id`),
KEY `ref_company_id` (`ref_company_id`),
FOREIGN KEY (`ref_company_id`) REFERENCES `ts_company` (`company_id`)
) TYPE=InnoDB


[/CODE]
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not duplicate post.

To answer your question for both posts as previously stated, DO NOT USE COUNT(*) FOR AUTO_INCREMENT, your record count is out of sync with your data.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37252
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue conversation in your other thread.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!