Installing Apache and Tomcat and Mysql on Windows 7
|Installing Apache and Tomcat and Mysql on Windows 7 - Installing JDBC|
|Written by Administrator|
|Sunday, 05 December 2010 15:26|
Page 8 of 9
Installing JDBCSo jdbc is in java.sql.* which comes with your jdk. However, I seem to remember having to put a mysql connector or something in the Java classpath for the Tonido Plug, and I’ll bet I should do the same thing here on Windows. Here’s what Oracle’s site says about it:
To use the JDBC API with a particular database management system, you need a JDBC technology-based driver to mediate between JDBC technology and the database. Depending on various factors, a driver might be written purely in the Java programming language or in a mixture of the Java programming language and Java Native Interface (JNI) native methods. The JDBC web site maintains a list ofvendors with drivers currently available or under development.
So I googled for ‘mysql jdbc connector’ and landed on the this page, which looks like I can just download a .zip file.
So after unzipping the file, I navigated in one level deep and found the following jar file:
This puppy needs to be in the java CLASSPATH, which is always a nightmare, so I will try to avoid that by simply copying the file to
Hopefully now all Java programs will be able to find it.
No luck so far. The only way I have been able to run my java program from the command line and have it find the mysql connector is to put the
java -cp . JDBCTest
I don't understand why setting the CLASSPATH enviornment variable does not work, or even putting in the java/lib/ext folder doesn't work.
|Last Updated on Sunday, 05 December 2010 18:27|