• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

creating one jdbc configuration file for the entire web applicaton

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using netbeans IDE and mysql database for my development in servlet and JSP. I created a java class as it contains all the configuration code to connect to my db. In another java class file i wrote code to retrieve data from db and to display. And it is working absolutely fine. Even I am getting the display of records on the console. But when i am trying connect to db from servlet, I am getting SQLException stating no drivers found. As I want to use single database connection file and use it within the entire web-application.
Please help
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then the Driver has not been loaded. You might want to use a ServletContextListener and do all necessary steps there and then just pick up on those in your servlets.

You might also want to consider using JDBCSupport for your projects. It makes SQL interaction a lot easier.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i think your driver jars can be deployed to your web container(Tomcat may).

open your web container directory. example in tomcat:
x:\tomcat\webapps\your context\WEB-INF\lib\
check your jdbc driver jar is it in this path?
if not, redeploy the project with your ide..
try..
good luck..
 
reply
    Bookmark Topic Watch Topic
  • New Topic