• 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

where to keep database drivers in Eclipse IDE

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I want to connect to a mysql database from servlet, I need to load the driver for mysql using Class.forName(mysql driver)

Where do I need to keep this MySQL driver in eckipse IDE ? I mean in order to load this driver, I have to keep it at some default location so that forName() can load it. So whats this default location ? Can I also provide a complete path to the driver location ?

Thanks
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a servlet, you do not need to have the driver in Eclipse anywhere. Instead, you should place the driver in the proper location for your app server. If the app server allows you to place the driver JAR in your WAR, then add the driver in the Libraries tab of the Java Build Path of your project's properties. If you let us know which app server, we can be more specific.
 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont understand. If I am connecting to MySQL from servlet, how will the connection be made to database without driver ?
I am not using any app server, I am creating servlet only for practice purpose. Anyways later on I plan to use WebSphere.

1) If I dont have MySQL driver will the driver still be loaded ? Does Eclipse come with database drivers preloaded ? If not, then from where does a driver get loaded to make connection ?
2) If I have MySQL driver stored in any directory on my computer, will it be automatically located and loaded in server ?
3) Do I need to store driver in a particular location only ? if yes, where ?

Please answer these questions pointwise and it will help remove confusion and make picture clear.

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic