• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not able run mysql based jdbc program  RSS feed

 
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.
 
Bartender
Posts: 11445
18
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.
 
Java Cowboy
Sheriff
Posts: 16078
88
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).
 
Marshal
Posts: 56903
174
  • 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?
 
author & internet detective
Marshal
Posts: 37708
578
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?
 
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
Boost this thread!