permaculture playing cards*
The moose likes JDBC and the fly likes Java, mysql, xml related problem 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 "Java, mysql, xml related problem" Watch "Java, mysql, xml related problem" New topic
Author

Java, mysql, xml related problem

torsti koistinen
Greenhorn

Joined: Jul 29, 2004
Posts: 4
I have created project management software with Java and MySql and it works fine.
This applet gets and writes information directly to MySql database.

Problem is that those sqlClauses below(update and insert) should go "through" xml "document" and i haven�t got idea how to do that.
If someone could give me advices or even tell me how I must modify my code I would be very grateful.

My english is not so good, so my problem sentence could be little hard to understand, but please try. If it�s too hard to understand please tell me even how can i save results of those clauses to xml "document". (soap?)



Here is part of main program:


And here is database connection class which i have created:


[edited to disable smilies - in the future, you can do it by clicking the disable smilies button in the options section (near the bottom) of the posting page]
[ August 09, 2004: Message edited by: Jeanne Boyarsky ]
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Hi Torsti,

Welcome to JavaRanch. Your English is fine - certainly a lot better than my ... um ... give me a clue ... somewhere in Scandinavia or around the Baltic? Anyway, it's better than any of my foreign languages!

It would be easier to help if you could give us an idea of why you want to save the data as XML and in MySql. Or why you want to convert to XML as an intermediate stage.

A simple answer to the question I think you're asking is to make sure that your data container class conforms to the JavaBeans specification (read the docs if you're not familiar) and then just use the java.beans.XMLEncoder class to write to a file. See example:

If you need to do something more complicated than that then you'll need to look at using JAXP. Check out the tutorial on Sun's website.

Hope this helps.

Jules
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java, mysql, xml related problem
 
Similar Threads
performance issue in iterating through large list of result set
Searching problem
Java&sql mystical problem with Switch
jsf and database connection problem
LOAD DATA INFILE problem