• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

insert data using xml

 
nishi kishore
Ranch Hand
Posts: 32
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,
i have a database named as EmployeeDB in mysql.
i want to create a struts 2 web application with hibernate.
i have a registration jsp file in my web application.
i have these fields in this jsp file :
username, firstname,lastname,password,address,phoneno.
i want to insert the values of these fields from my jsp file(Register.jsp) into the table named as empRegister as well as in the generated xml file(employee.xml).
when i want to retrieve the data into my jsp file(empView.jsp) , it should be from the generate xml file(employee.xml) not from the empRegister table.
it means that i want to interact with database only at the time of data insertion and at the time of retrieval, there will be no interaction with database. at the
time of retrieval of data, it should be from xml(employee.xml) to my jsp file(empView.jsp). please suggest me the code for solving this issue.

thanks and regard
nishi kishore
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a fine approach. You'd have two Struts actions. One would update the database with Hibernate and the XML file using a XML parser. The other would "query" the XML file.

What are you stuck on?
 
nishi kishore
Ranch Hand
Posts: 32
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am clear with the approach but what about the code.
i know that i have to take two actions : one for the updation in the database and second for the xml.
i can update the database but i am stuck in xml.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic