This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

java.sql.SQLException: No suitable driver  RSS feed

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All ,

I am new to jsp , trying to work with data source (mysql ) using tomcat 6 , I have read the tutorial from the link


but am getting the following error :





I have placed mysql connector jar in tomcat lib as well as in my example project web-info/lib , but still getting the same error

context.xml





web.xml




test.jsp





by the way i have another jsp page in the same example project which access the database but without data source and it worked fine

Any suggestion .
 
author
Bartender
Posts: 4096
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never connect to a database inside a JSP!!!

That said, have you tried checking the JDBC FAQ? It doesn't look like your register the driver, ie Class.forName().
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Scott Selikoff for your reply ,

As per your reply I have make the data connection in a separate bean & i have registered the driver as the following





, but am getting the same error ..



any suggestion
 
Ranch Hand
Posts: 247
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have mysql-connector jar file in tomcat lib since all other web applications will use it...

And make sure that the CLASSPATH has been set for mysql-connector jar in tomcat lib...
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ram thanks alot for your reply,

I have followed your steps in your reply but still facing the same issue.
 
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two ways to get the Connection Object

1)DataSource
2)DriverManager

seems like you are trying both if you are just doing some test application use DriverManager find out the difference between DataSource and DriverManager
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Malatesh Karabisti for your reply ,

There are two ways to get the Connection Object

1)DataSource
2)DriverManager

seems like you are trying both if you are just doing some test application use DriverManager find out the difference between DataSource and DriverManager






I have already did some small test applications using DriverManager and it worked fine now I want to use DataSource but am still getting this error ........
 
Suresh Khant
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestion............
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm facing the same issue trying to use a DataSource with tomcat6 and mysql. Did you ever figure out the issue?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!