• Post Reply Bookmark Topic Watch Topic
  • New Topic

sql error  RSS feed

 
Peter Guillebaud
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
My jsp page returns a ClassNotFound Exception trying to access a mysql database. It complains that it can't find the driver. I think I have the classpath set up correctly as an ordinary class run locally can access the same database using the same driver and return a resultset ok. Any ideas?
Thanks in advance...
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're building your application as a J2EE web application (i.e. a WAR file or directory structure with the WEB-INF/web.xml deployment descriptor), a good place to put your database drivers is in the WEB-INF/lib/ directory. Simply stick your .JAR file in here and the classes will be automatically loaded for you by the web container, therefore eliminating the need to set the CLASSPATH before starting the server.
Hope that helps
Simon
 
Peter Guillebaud
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Simon,
Thanks very much - problem solved! Also has the benefit of keeping the new web app self-contained.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!