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.
Ulf Dittmer wrote:I've never seen the @myhostname.com designation of a server, nor the colon before the DB name. A quick googling found http://stackoverflow.com/questions/1457716/what-is-the-mysql-jdbc-driver-connection-string
I changed it as the link says but I still get the same error. I am sure that I am doing something wrong concerning the driver but I have no idea what. While something may be wrong with the connection string, if that were my first problem, wouldn't I get a connection error rather than what I am getting?
Ulf Dittmer wrote:That doesn't look like what's mentioned in that article. It has a domain name instead of host name, and it's missing the slashes. Or is the server actually named "myHostName.com"?
The server is not named "myHostName.com" I simply replaced my real one so that it is not posted on the forums. What I am using is my goDaddy domain name.
I added the slashes (thanks for pointing that out) and it seems to work now but I am getting access denied so now I must figure that out. I think it is something on the server end.
Thanks for working through this with me. I will post again if I figure out the access issue.
Raymond Gillespie wrote:
Ulf Dittmer wrote:I'd be amazed if using a domain name works. Usually you'd need an IP address or the physical server name.
It works. I just had to add my IP address to the remote access list inside of Cpanel.
Man you are god, I cant tell my wishes for you now. Yousolved my problem with this message