This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes database and xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "database and xml" Watch "database and xml" New topic

database and xml

clyde melly
Ranch Hand

Joined: Sep 04, 2003
Posts: 152
an XML file, called agents.xml, containing the details of at least 5 travel agents. The structure of the file is as follows:
<agent eno="" name="">
<region></region >
How to populate a Microsoft Access database with the agents details and to read the data from the database in the correct order for displaying.
Will it involve first insert and then selecting.Is there another way around
for inserting my xml file into the database.
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
You'll need to read the <agent> elements from the XML file one at a time and make an SQL INSERT for stuffing the data into the database. I gave you an example of the first part in the XML forum.
Here's a piece of code that will do the inserts:

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: database and xml
Similar Threads
XSL-FO: line break in XML-Tag is not displayed in PDF
servlets and xml
Allowing & br tags to show using XSL
Need help in parsing text file with list to XML
how to I use servlets with xml