Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

help needed to convert ms access mdb files to xml files  RSS feed

 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a directory structure containing MS Access (mdb files) .I need to convert each mdb file to corresponding xml,xsd files.

Can someone help me with the java api/documentation that I could use to perform this task?

Would really be thankful if someone could post some sample code for the conversion.

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you dont say what the resulting XML is to be used for I will have to take a guess.

Your first step will be to define what you want the XML to look like.

I suggest using a text editor to create an example XML document using reasonable data.

Bill
 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response!

The Xml will contain the data that is inside the mdb database files.I need to read the mdb files and the data inside it using Java api which I am not sure which one to use and create corresponding xml files for each mdb file.

I want to convert this(from mdb to xml) as it is the required format for our supporting application.

The format of the xml file is something similar to the one seen below:


Regards

Moieen
 
Paul Clapham
Sheriff
Posts: 22678
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just create a FileWriter (with encoding ISO-8859-1) and write the XML document to it.
 
Moieen Khatri
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any Java class/api to read the data from the files with .mdb extensions?(MS-Access files)

Regards

Moieen
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So apparently you just want to turn a table into a XML document, not combine data from multiple tables.

You might be able to use the ServingXML toolkit - an open source project.

As I recall, the download includes SQL database to XML tools.

Bill
 
Paul Clapham
Sheriff
Posts: 22678
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moieen Khatri wrote:Is there any Java class/api to read the data from the files with .mdb extensions?(MS-Access files)


That's JDBC.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!