• Post Reply Bookmark Topic Watch Topic
  • New Topic

Where to put the MySQL driver ConnectorJ WITHOUT changing CLASSPATH?

 
Peter Steiner
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally, when I try to connect a Java program to a MySQL database I need a MySQL driver e.g. "mysql-connector-java-5.1.40-bin.jar".

Therefore I have to add the path where this *.jar is stored to the CLASSPATH.

However assume I don't want to change the CLASSPATH and don't want to peek into the current CLASSPATH.

Instead I want to copy the *.jar to a directory which is (almost) always included in CLASSPATH (on all systems) by default.

What is the recommended folder for that?

Is there a dedicated "driver" subfolder in J2EE installation for that?

Peter
 
Knute Snortum
Sheriff
Posts: 3332
84
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tell us more about how you plan to distribute your app.  For instance, are you going to package it in a jar file?
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!