Solved

getting jdbc to work on a mac os

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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now