Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

add new row in table  RSS feed

 
Jess Lim
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guy,
do u know how to add a new row into a table when clicking 'Add' button?

thank you for help.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Jess Jess",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know who "u" is, but I'll try to give you a start:

1) When the button is clicked, a request is made to a servlet (usually via a form submission).
2) The servlet gathers the data for the entity to be added.
3) The servlet calls a "model" class that's in charge of persistance for the entity in question.
4) The model class uses JDBC to insert a record into the appropriate table.
5) Control returns to the servlet which forwards to a JSP that shows whatever results are appropriate.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!