Hi,
I tried to combine in memory mysql database with Mapreduce to do some
value exchanges. In the Mapper, I declare the mysql driver like this
import com.mysql.jdbc.*;
import java.sql.DriverManager;
import java.sql.SQLException;
String driver = "com.mysql.jdbc.Driver";
try{
Class.forName(driver);
}...
but it returns an error: java.lang.ClassNotFoundException:
com.mysql.jdbc.Driver
It looks like the class file cannot be found. I put the mysql jdbc jar
file under hadoop\lib\ folder. This error only occurs when the jdbc
connection is declared in the Mapper, all the other functions outside of
the mapper work fine. I also tried to ant the jdbc jar file together
with my class in a same jar file, but still get the error. Is there any
special configuration required for jdbc connections in Mapper class?
Thanks.
BR,
Shi
--
Postdoctoral Scholar
Institute for Genomics and Systems Biology
Department of Medicine, the University of Chicago
Knapp Center for Biomedical Discovery
900 E. 57th St. Room 10148
Chicago, IL 60637, US
Tel: 773-702-6799