Connecting to MySQL with connector/J
Posted by: ryepie (---.sd.sd.cox.net)
Date: March 10, 2010 05:00PM

Hi,

I'm pretty new to apache and the wamp server and I have a couple of questions concerning how to connect to my mysql db using a java program. I've also been unable to connect to mysql using mySQL query browser (which I prefer to use when developing php scripts) which may or may not all be part of the same problem.

I can connect just fine using phpscripts from a local website, however when I attempt to connect using jdbc connector the server wont respond and I get the following error:

Exception: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

I am using the eclipse ide and running the program from another pc on my lan. I was able to successfully add the classpath for the connector in eclipse. From what Ive read online I need innodb tables enabled to use a jdbc connector? When I installed wamp, I did not enable Innodb.

When I go into my.ini and uncomment the innodb section mysql will not start as a service. Are there more steps I'm missing or do I need to enable innodb at all. Also do I need to be running an app server like glassfish or tomcat in order for the jdbc connector to work or is that simply for pooling connections and not necessarily needed for a simple connect application.

I've been researching this for about 2 weeks and nothing I try works. I am getting more confused by the day and am simply at a loss. If you need more info from me to help resolve, just let me know what you want me to post. I am unsure at this time exactly where to start.

Options: ReplyQuote
Re: Connecting to MySQL with connector/J
Posted by: ryepie (---.sd.sd.cox.net)
Date: March 10, 2010 06:59PM

It seems I should ask for help more often, because as soon as I do, I usually figure out the problem winking smiley

The problem was my windows firewall on my server pc. I never added exceptions to my firewall. After doing so I am able to connect with both mysql query browser and java using connector/j.

Options: ReplyQuote


Sorry, only registered users may post in this forum.