Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Design for the Mind this week in the Design forum!
  • 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: 34178
340
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