Connecting to a MySQL DB in Java

And here it is: Another small tutorial :-) This time we will build a small Java application that simply connects to a MySQL database and prints the conent of one of the database's tables.

Hi

I just wanted to thank you for sharing your code above with the public (here along me). Thank you so much. For the last couple of days I have been unsuccesfull in connecting to my database, but now, following your code and setting up different classpaths, it finally succeeded ...thanks to you. Also a nice feature to give some code for fetching data from a table..also worked for me..

Yours sincerely , Gitte Bager from Denmark

Gitte Bager on March 17, 2005 at 10:25 +0100

Thanks you for these nice words :-)

zerok on March 17, 2005 at 16:56 +0100

Thank you! I have been trying for the past 45 minutes to get the JDBC driver to work under Gentoo and I just couldn't get it! A google search for Gentoo and the driver name got me to your site, and the export CLASSPATH statement did it! Thanks again!

Nick Garvey on May 23, 2007 at 03:07 +0200

Comment on this

You can use Markdown here.

Please answer the question in this field. It should help keeping spambots out ;-)