Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able run mysql based jdbc program

 
gyan kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have mysql-connector-java-5.1.0-bin.jar should I put in classpath of windows environment variable. In web application I read we can keep in lib directory.
or

there is any other way.
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WEB-INF/lib is the recommended way.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15207
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are also other ways, but it depends on what servlet container you're running your application in. For example in Apache Tomcat you could also put your libraries in a special lib folder somewhere under the Tomcat installation directory, so that these libraries would be seen by all web applications. (I don't know if this is still possible with Tomcat 7.0, see the Tomcat documentation).
 
Campbell Ritchie
Sheriff
Posts: 48402
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this discussion would sit better on our JDBC forum: moving.
 
gyan kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if my application is not web application then where should I keep/set this .jar file to run my program/application?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anywhere on your machine. Where do you keep the rest of the application?
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the best place is inside your software and add it to the software class path.

There you will have the control over it more cleary.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic