com.cloudera.sqoop.manager
Class GenericJdbcManager

java.lang.Object
  extended by com.cloudera.sqoop.manager.ConnManager
      extended by com.cloudera.sqoop.manager.SqlManager
          extended by com.cloudera.sqoop.manager.GenericJdbcManager
Direct Known Subclasses:
HsqldbManager, MySQLManager, OracleManager, PostgresqlManager

public class GenericJdbcManager
extends SqlManager

Database manager that is connects to a generic JDBC-compliant database; its constructor is parameterized on the JDBC Driver class to load.


Field Summary
static org.apache.commons.logging.Log LOG
           
 
Fields inherited from class com.cloudera.sqoop.manager.SqlManager
options
 
Constructor Summary
GenericJdbcManager(java.lang.String driverClass, SqoopOptions opts)
           
 
Method Summary
 void close()
          Perform any shutdown operations on the connection.
protected  void discardConnection(boolean doClose)
          Any reference to the connection managed by this manager is nulled.
 java.sql.Connection getConnection()
          Retrieve the actual connection from the outer ConnManager.
 java.lang.String getDriverClass()
           
protected  boolean hasOpenConnection()
           
 
Methods inherited from class com.cloudera.sqoop.manager.SqlManager
execAndPrint, execute, exportTable, formatAndPrintResultSet, getColNamesQuery, getColTypesQuery, getColumnNames, getColumnTypes, getPrimaryKey, getSplitColumn, importTable, listDatabases, listTables, makeConnection, readTable, release, toHiveType, toJavaType
 
Methods inherited from class com.cloudera.sqoop.manager.ConnManager
escapeColName, escapeTableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG
Constructor Detail

GenericJdbcManager

public GenericJdbcManager(java.lang.String driverClass,
                          SqoopOptions opts)
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Description copied from class: SqlManager
Retrieve the actual connection from the outer ConnManager.

Specified by:
getConnection in class SqlManager
Returns:
the actual database connection.
Throws:
java.sql.SQLException

hasOpenConnection

protected boolean hasOpenConnection()

discardConnection

protected void discardConnection(boolean doClose)
                          throws java.sql.SQLException
Any reference to the connection managed by this manager is nulled. If doClose is true, then this method will attempt to close the connection first.

Parameters:
doClose - if true, try to close the connection before forgetting it.
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Description copied from class: ConnManager
Perform any shutdown operations on the connection.

Overrides:
close in class SqlManager
Throws:
java.sql.SQLException

getDriverClass

public java.lang.String getDriverClass()
Specified by:
getDriverClass in class ConnManager
Returns:
a string identifying the driver class to load for this JDBC connection type.


Copyright © 2010 Cloudera, Inc.