Connect MySQL in Java

Some basic simple SQL connection to collaborate together with Java. As of now, since I am in this Java field, why not I share my own experiences and stuffs. Since this is a half technical half personal blog, as a Java Developer, and if you’re looking for a way to connect mySQL to your Java application. Just do this 2 simple steps.

Class.forName ("com.mysql.jdbc.Driver")

conn = DriverManager.getConnection (url, userName, password);

You have now established connection with mySQL database using Java. Of course, you need the MySQL library which you can download it on this page.

Leave a Reply