• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tomcat - mysql : Connection refused

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I am learning how to connect to mysql database through tomcat,
and I am experiencing a problem.
I have followed the instrunctions detailed in :
Apache Tomcat Faq Page
the problem is that invoking:
http://localhost:8080/DBTest/test.jsp

I get the page with output:
Results
Foo Not Connected
Bar -1

and also the error in the log:


As someone told I checked the ports on my machine, and I have correctly set up mysql on port 3306, tomcat on 8080.
I have a firewall(Sunbelt Kerio), but I've already disabled it.

Any idea please?
Thank you in advance.
Gianni
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your mysql server running?

Seems that the port is not open, you can quickly check if the 3306 port is open by doing a telnet to it :

telnet localhost 3306
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I like doing a netstat -a on windows. Tells me what ports close to the one I want are open as well.

Shoot us the file that has your connection information and maybe we can see an error.

-Cameron McKenzie
 
gianni ipez
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your answers.
if I check mysql in the services running I can get it.
It says started.

here are the answers at the prompt commands:
>telnet localhost 3306:
L
6.0.2-alpha-community-nt-debug♥a]0stmGY,☻j*.Ha.a~x]K?

Connessione all'host perduta. (that means host connection lost)

when doing
>netstat -a:


Is there helpful?
Is this meaning something to you?
Thanks again!
Gianni
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I burned with the same problem for long time. I fixed that.
Just download the JTDS JDBC Driver and unpack it. Copy the jtds-1.2-dist.zip file that you download from Sourceforge in to %TOMCAT_HOME%/common/lib.

That�s all. Restart your Tomcat and try again.

JTDS JDBC Driver Download Link:
http://sourceforge.net/project/showfiles.php?group_id=33291
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic