Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web Application is throwing a 'No Suitable Driver Found' in mysql statement

 
Joe Ridener
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


The above code will print the statement above the connection object but will not print the statement below the connection statement.... below is the error in the console window ( and yes I double checked the spelling on my database.. it is correct, and imported the mysql jar into my buildpath project) I recently moved my web app which could but cannot figure this error out.

No suitable driver found for jdbc:mysql://localhost:3306/index_



 
Joe Ridener
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BTW this code USED TO WORK just fine it was when I moved it into a new IDE. That this error was started. I am thinkiing maybe this .jar file does not work well on Indigo very well as it is new... any input is appreciated

It is likely the JDBC driver incompatability with Indigo as many newer versions do not work on it. Any ideas on where to find an archive? this may work...
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you moved it into a new IDE... perhaps the old IDE had the driver's jar file in the project's build path and the new IDE doesn't?
 
Joe Ridener
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:So you moved it into a new IDE... perhaps the old IDE had the driver's jar file in the project's build path and the new IDE doesn't?


Yes I know how to do the build path and it has 'A Jar' file but alot of newer versions of things like servers...
for example my weblogic and tomcat servers did not work and had to make a special point to dl old software that would run


now I did dl an old driver for the JDBC but that still did not work...

I am on an Indigo because the other Eclipse does not come with the EE out of the box....
I have installed the EE several times but drew a blank and had to get an Eclipse that was ready to
go upon installation of it. For example on the new Keplers it will not let me create a Dynamic Web Project
even in the EE perspective and had server issues that youd imagine I would have.

So I am running an old APache Tomcat works great .. but it will not let me access my MySQL db. even though I have an old driver
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps the "old driver" isn't JDBC 4 compliant, meaning that you would have to call "Class.forName(the driver class)" like you used to have to do before Java 6.
 
Joe Ridener
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I just tried that ..

the error was this

java.lang.ClassNotFoundException: mysql-connector-java-5.1.25-bin.jar

and I am looking right at the .jar file in my library

as a matter of fact I copied and pasted that from the properties menu of the .jar in my web app library

any ideas?

I usually get my db running... this is strange

BTW this is on a new Kepler and not the Indigo... since we last spoke I reinstalled and took care of that.... still having the same exact problem though...
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So there you go. Either the jar file isn't in the build path of your project, or it doesn't contain that class.
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh wait a minute. The IDE is just a red herring, right? You're getting this error in your web application. Which would mean that you didn't include the jar file in your WEB-INF/lib folder when you deployed it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic