• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding adding form data to 2 tables on single click without Hibernate.

 
Rahul Ba
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have form where user can specify the username,pwd, address, roles. NOw, I need to put the username and pwd in single table and rest of the values in another table.
There is key relation is between this two tables.

How to write code in servlet to achieve this.

Please guide me.

Thanks in advance.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JDBC (that's a hint).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or the answer. When you write the SQL, you'll have a join between the two tables.

If you have questions once you start, post back here.
 
Rahul Ba
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
joing two tables in sql is fine, but do we need to write 2 sql insert statements.
 
Lino Larios
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could call to a stored procedure to make a more efficient job, and maybe inside the store procedure perform two inserts.

http://onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic