• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML Schema -- Java -- MySQL

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to develop an XML schema for some biological data and then write a tool in Java to produce a MySQL database. I found enough resources/tutorials for writing XML schemas but I don't have any idea how to go from XML Schema to MySQL database through Java.
I would appreciate your suggestions.
Thanks,
Vagisha
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there.If you did solve your problem can you help me in the same.I am also facing the same problem as concerned the Population of Database Scehamas to a XSD/XDR/XML/XML Schema.
Thanks in advance
Regards
Ritesh

Originally posted by Vagisha Sharma:
I have to develop an XML schema for some biological data and then write a tool in Java to produce a MySQL database. I found enough resources/tutorials for writing XML schemas but I don't have any idea how to go from XML Schema to MySQL database through Java.
I would appreciate your suggestions.
Thanks,
Vagisha


 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am doing the same with a LotusNotes Database.
(If your my_SQL just has one table it will work, the more complicated the database_structure the more dificult the task)
These are the steps I followed:
1. Create a XML Document
2. Parse the Document with SAX (its faster) and write one Data_Row in a java.util.Map with some sort of an id as key. With a Map you'll have lots FieldName---FieldValue Pairs. Put all the Maps in a Vector.
3. Iterate the Vector. Iterate all Map key-Value pairs and write the Database_Code you need (JDBC).
I did not write it directly from Sax to LotusNotes because programs looks more simple as it is now.

Would apreciate better suggestions
Axel
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps try this tutorial??? Using JDBC to insert data from XML into a database by IBM.Developerworks
Axel
[This message has been edited by Axel Janssen (edited October 30, 2001).]
 
Vagisha Sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Axel,
Thanks a lot for the link. The article was useful. I'm sorry I took so long to reply.

-Vagisha
 
My honeysuckle is blooming this year! Now to fertilize this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic