Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

Tomcat & MySQL Connection Problem

Thread view: 
Bryan - 13 Jul 2007 14:24 GMT
Hello All,

I'm having some trouble connecting to a MySQL database from some Java
code I have running in Tomcat. I'm positive my credentials are correct
because I can access the DB using the command-line client. The DB is
on the same machine as the Tomcat server and is listening on the
default port. Tomcat is not running under a security manager. This
code works just fine on a development machine that's configured the
same, but when I move it over to my production machine I get a
CommunicationsException. I've added some output statements in my code
to see just how much goes on before I get the exception and it looks
like it happens the very first time I try to connect. I've read where
people usually get this exception after a connection has timed out,
but I don't think that's the case here. I've considered a DB
connection pool, but I'm not sure if that would help since it's
happening the very first time I try to connect. It even does it right
after I restart MySQL and Tomcat.

Any and all suggestions will be greatly appreciated!
Nigel Wade - 16 Jul 2007 10:30 GMT
> Hello All,
>
[quoted text clipped - 15 lines]
>
> Any and all suggestions will be greatly appreciated!

Provide more information.

What is the exception? Please post it verbatim, not a "something like"
explanation.

When you say that it works on a development system but not the production system
I presume you mean the same code in an identical environment on both systems?
Is the MySQL account you are using allowed to connect from the production
system - don't forget that MySQL accounts are host based, i.e you specify a
userid *and* host (which may be a wildcard). Do you connect to MySQL using the
FQDN or localhost? It makes a difference.

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.