0

I have a table with one row..user can add or delete rows(using javascript to add dynamically)..

How can I send the data entered in the rows to database and also should retrieve the same when user comes back to see the data in future..using hibernate for mapping..using spring form tags and model attribute..

just need a brief idea on how to send dynamic data to database using hibernate

any suggestion is appreciated...thanks in advance!

1 Answers1

0

Take a look at this post about spring+hibernate integration. There are plenty of examples of these technologies usage.

http://www.mkyong.com/spring/maven-spring-hibernate-mysql-example/

Edited: I think the easy way would be:

1) Retrieve data from your table and send it via Ajax using JQuery, take a look at this example.

2) Use a Servlet to reive your JSON data, convert it to an object using json-lib, here some snippets from the official page.

3) Return data as json, and make sure you use the correct "application/json" content type.

If you are planning to send ajax data in various scenarios in your application, consider to use a framework like Jersey or Restlet to send JSON data via RESTFUL services to implement your server side componentes instead of using just a servlet.

Community
  • 1
  • 1
kothvandir
  • 1,771
  • 2
  • 15
  • 30
  • sorry for confusion...not looking for spring and hibernate integration..i have implemented it..but, one of my form has a table with dynamic rows added from javascript..i need to send that data to database... –  Sep 06 '12 at 15:54
  • What are you using to implement yoru presentation login, JSF, JSP, ...? what js framework are you using? – kothvandir Sep 06 '12 at 16:15