Hello all. I could really use some help. I am trying to connect to a MySql database on goDaddy and I cannot get this to work. I am sure there is something wrong concerning the
JDBC driver but I cannot figure out what it is. I have spent hours on Stack Overflow and it seems every
thread I read says the same thing, which is "make sure to add the classpath to the driver. I have did this, I think, and it still will not work. I am getting this error:
What I have done so far is downloaded the driver from
MySQL Connector/J. I unzipped the directory and put it into my
Java folder on the C: drive since that is what I did with the MS SQL driver. I then went into my environment variables, added a new variable called CLASSPATH and gave it the value of C:\Program Files\Java\mysql-connector-java-5.1.29\mysql-connector-java-5.1.29-bin.jar
I also read that I should put that jar file into the
Tomcat lib directory so I did that.
I also read that I should do the following:
Right click project
Go to properties
Go to libraries tab
Click Add External JARs
Find the above JAR file and add it
I have done this as well. I have restarted the Tomcat server and as far as I can tell, rebuilt the project.
I must be doing something wrong or missing something but I have no idea what. Below is my code and below that is the error.