Solved

getting jdbc to work on a mac os

Posted on 2011-03-03
3
1,059 Views
Last Modified: 2012-05-11
Hi...

I used sudo port install mysql-connector-java to install a mysql connectory for jdbc.

Whe I try and execute this command...

sqoop import --connect jdbc:mysql://ubuntu@xxxxx.com/testdb1 --table test -m 1

I get this error

11/03/04 16:47:45 INFO tool.CodeGenTool: Beginning code generation
11/03/04 16:47:45 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
      at com.cloudera.sqoop.manager.SqlManager.makeConnection(SqlManager.java:597)
      at com.cloudera.sqoop.manager.GenericJdbcManager.getConnection(GenericJdbcManager.java:51)
      at com.cloudera.sqoop.manager.MySQLManager.execute(MySQLManager.java:201)
      at com.cloudera.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:177)
      at com.cloudera.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:161)
      at com.cloudera.sqoop.orm.ClassWriter.generate(ClassWriter.java:908)
      at com.cloudera.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:82)
      at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:337)
      at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:423)
      at com.cloudera.sqoop.Sqoop.run(Sqoop.java:144)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
      at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:180)
      at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:218)
      at com.cloudera.sqoop.Sqoop.main(Sqoop.java:228)

How to I fix so I can use jdbc

I also have the jar fle from the mysql website.
0
Comment
Question by:dmontgom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 35033965
you need to add the (installed) jars to your classpath
0
 
LVL 92

Expert Comment

by:objects
ID: 35033970
you can achieve that by copying the jat to $SQOOP_HOME/lib
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 35034748
Copy the mysql driver jar to the lib/ext directory of your active java runtime
0

Featured Post

When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot has fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question