• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to insert foreign key into JSP through servlet

 
Gabriela Silva
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(JSP + Mysql + JDBC)







how insert foreign key (idCity) into district?




 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34972
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!

You can write some code to return the primary key for cities created by the database. Here is an example. Then it is easy stmt.setString(3, returnedValue);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic