Doesn't java have a library that lets you connect to MySQL through like ODC or something?
You need to use an external library to be able to connect to a mysql database in Java because Java does not offer standard connectivity to a mysql database afaik. Download it here:
http://www.mysql.com/products/connector/j/ there are a few code snippets on the forums that shows you how to retrieve mysql data from java. Just look around or ask for it in one of the boards and i'll see what i can do for you.