aspose file tools*
The moose likes JDBC and the fly likes howto create foreign key in mySQL ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "howto create foreign key in mySQL ?" Watch "howto create foreign key in mySQL ?" New topic
Author

howto create foreign key in mySQL ?

Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
hi, i'm not sure how to i create foreign key in mySQL, can anyone guide me on this ? is mySQL support foreign key ? it like a bit difficult to get the mySQL foreign key info from website ..thank you guidance
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

MySQL didn't used to support FKs constraints. There something about this in the docs, but I think only the InnoDB engine does. The default engine people use tends to be the MyISAM one, which doesn't support FK constraints. So first you have to convert or create your model with InnoDB tables then read the documentation aboout creating FK constraints.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
just wondering , as default engine doesn't support foreign key , how to solve foreign key problem ? is it the only way which means to convert DB type ? thank you !
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

which foreign key problem?

I lived 10 years very well without foreign key information from metadata, because I needed the information about the relationships before programming my applications - and I got it from documentations.


http://home.arcor.de/hirnstrom/bewerbung
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: howto create foreign key in mySQL ?
 
Similar Threads
About MySql
adding foreingkey is error?
Hibernate problem - creating duplicate foreign key index
Game on SQL
Mysql query