This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes multiple primary key exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "multiple primary key exception" Watch "multiple primary key exception" New topic

multiple primary key exception

niya nair

Joined: Sep 19, 2007
Posts: 11
hai all
i am getting an exception like
MySQLSyntaxErrorException multiple primary key defined.
my query is

CREATE TABLE `first_item` (
`itemid` int(5) unsigned NOT NULL default '0',
`subitemid` int(5) unsigned NOT NULL default '0',
PRIMARY KEY (`itemid`,`subitemid`)
i am using innodb as the database engine.
can someone give me any suggestion please.

[ November 19, 2007: Message edited by: niya nair ]
Edvins Reisons
Ranch Hand

Joined: Dec 11, 2006
Posts: 364
Your CREATE TABLE statement does execute in MySQL, and it creates a table.
It is sorta covered in the JavaRanch Style Guide.
subject: multiple primary key exception
It's not a secret anymore!