• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to insert foreign key into JSP through servlet  RSS feed

 
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
Sheriff
Posts: 36446
454
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);
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!