Solved

getting jdbc to work on a mac os

Posted on 2011-03-03
3
1,044 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This video teaches viewers about errors in exception handling.
Suggested Courses

751 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