This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
    Bookmark Topic Watch 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown
  • Mark post as helpful
  • send pies
  • Report post to moderator
Q. Why do I get a No Suitable Driver exception

This exception has two potential causes. One make sure that your Driver is being loaded correctly AND that it is registering itself (which it really should) with the DriverManager.

Two, your URL is incorrect and the Driver you want to use isn't recognizing it.

Q. Why do I get a NoClassDefFoundError exception when I try and load my driver

Your classpath is incorrect and Java cannot find the driver you want to use.

Please consult HowToSetTheClasspath to remedy this.

Q. Why do I get a NoClassDefFoundError: org/aspectj/lang/Signature when I try to connect to MySQL

This issue relates to some confusion on the MySQL site between the normal MySQL driver and a special debugging/tracing mode driver. This error indicates that you are attempting to use the tracing driver instead of the normal driver.

Download and use the normal driver instead. It is the one without the g in the name of the jar file.

Q. Why do I get a connection refused exception

There are several things you need to check to isolate the source of this type of exception.

  • your database server is accepting TCP connections.
  • Check that your database server is running on the server address you think it is
  • Check for firewalls. Is there a port or ports being blocked between your application and the database?
  • Check that you are not having a security problem. Is your application an Applet? If you are connecting to a database that is not on the same physical box as your web server then you need to sign your applet.
  • Check that you are using the right username and password
  • Check that the database user has the correct permissions and is able to log in from the location you are attempting to log in from.
  • Check that you are using the correct driver for your database. There often different versions of the same driver for the same database but different versions of the database since the underlying proctocol had some changes between versions.

  • If all that fails then consult with your DBA for assistance.

    Q. I'm getting exceptions when my applet tries to make a connection to the DB

    Applets are restricted in what they are allowed to do; that's a security precaution. The applet needs to be digitally signed, or the local security policy adjusted to get around this. Read this for solutions: HowCanAnAppletReadFilesOnTheLocalFileSystem

    You should note that you can connect unsigned Applets to a database server provided that database server is the same server that the Applet came from.

    However signed or unsigned it is not considered good practice to connect your Applet directly with a database of any kind. Doing so means opening your database to connections from the internet in general and is a highly unsafe practice.

    Login errors
    Login errors can have many causes - from the wrong IP to firewalls blocking you to a locked out account to more obscure issues like the wrong authentication mode on SQL server.

    Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
    Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
      Bookmark Topic Watch Topic
    • New Topic