Tuesday, 5 July 2011

Mysql-connector.jar for connecting java to mysql

This blog helps one how to connect java to mysql database, there are some steps to follow-
1) Set up classpath like this
 javac -classpath "C:\Program Files\mysql-connector-java-5.1.14\mysql-connector-java-5.1.14-bin.jar;." Connect.java(class name)

2) And when I execute program  need to use this:
java -classpath "C:\Program Files\mysql-connector-java-5.1.14\mysql-connector-java-5.1.14-bin.jar;." Connect(class name)

No comments:

Post a Comment