set classpath for mysql-connector.jar 1

set classpath for mysql-connector.jar

 JAVA_HOME  
 C:\Program Files\Java\jdk1.6.0

 PATH 
 C:\Program Files\Java\jdk1.6.0\bin;

 CLASSPATH
 .;C:\Program Files\Java\jre1.6.0\lib\ext\mysql-connector.jar;.;

Here is what the above code is Doing:
1. It’s creating a connection to the database.
2. It’s creating a statement object.
3. It’s executing the query and getting the result set.
4. It’s iterating through the result set and printing the values.

Similar Posts