SQLException: No suitable driver. what is this?

I writting an application using JSP/Servlets and i齧 trying to make a connection to a mysql db. But when a try to load the driver i get this message:

java.sql.SQLException: No suitable driver

The database is running ok, because i tested it with the mySqlFront tool. I齧 using Connector/J 3.0.7 and Tomcat 4.1.24 and j2sdk 1.4.1

Where might be the bug to be fixed? I don齮 know where to start looking for it...

Can anyone point me the way?

Thanks =)

[483 byte] By [gafma] at [2007-9-20]
# 1
Post the code that is relevant to connecting to the database. It's obvious there's something wrong in the actual code that creates the instance of the driver and connects to the database.James
jmccona at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
If its servlets, then you haven't put the jar file containing the driver in the right place. One place that works is .../YourWebApp/WEB-INF/lib.
DrClapa at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

hi gafm,

The error just means that the server cannot find the source classfiles for the driver that youare trying to load. You must put the jar files of the driver u are trying to use at $CATALINA/common/lib folder.

If you are sure that you have the correct jar files there, you can also check out for any typo errors in the Driver classname, you have given in the tomcat configuration files.. check that out..

all the best,

-Jer

jeremyja at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

gafm,

sorry to have got a small mix up..

no suitable driver.. means that there isn't a suitable driver to connect with the url u specified. verify if you have correctly loaded the driver (this needs the driver jars to be in classpath). and also whether u are giving the correct url to connect using the driver.

'cos as far as i know, jdbc the driver manager keeps tracks of registered and loaded drivers and uses the url to identify and correctly use the appropriate driver. so it generates error whenit cannot find a suitable driver for the url you gave for connection.

hope u got a lead into the prob..

Jer.

jeremyja at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
Thanks. Was just a mistyping. i wrote jbdc in the url instead jdbc.And i lost a couple of hours with so stupid error. Ahhhh ... I hate this computers ...
gafma at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...
# 6
LOL.. no need to hate them..'cos they do what we tell them to.. ;-Dunless their creators have taught them to do some other things.. Thanks for those dukes.. :-D-Jer
jeremyja at 2007-7-12 > top of java,Database Connectivity,Java Database Connectivity (JDBC)...