File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Not able run mysql based jdbc program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Not able run mysql based jdbc program" Watch "Not able run mysql based jdbc program" New topic
Author

Not able run mysql based jdbc program

gyan kumar
Ranch Hand

Joined: Sep 28, 2011
Posts: 61
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

Joined: Jul 26, 2007
Posts: 10360
    
    8

WEB-INF/lib is the recommended way.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14146
    
  18

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).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38793
    
  23
I think this discussion would sit better on our JDBC forum: moving.
gyan kumar
Ranch Hand

Joined: Sep 28, 2011
Posts: 61
What if my application is not web application then where should I keep/set this .jar file to run my program/application?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30516
    
150

Anywhere on your machine. Where do you keep the rest of the application?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

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.


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able run mysql based jdbc program