当前位置: 首页>>代码示例>>Java>>正文


Java OracleDBRecordReader类代码示例

本文整理汇总了Java中com.cloudera.sqoop.mapreduce.db.OracleDBRecordReader的典型用法代码示例。如果您正苦于以下问题:Java OracleDBRecordReader类的具体用法?Java OracleDBRecordReader怎么用?Java OracleDBRecordReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OracleDBRecordReader类属于com.cloudera.sqoop.mapreduce.db包,在下文中一共展示了OracleDBRecordReader类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: OracleDataDrivenDBRecordReader

import com.cloudera.sqoop.mapreduce.db.OracleDBRecordReader; //导入依赖的package包/类
public OracleDataDrivenDBRecordReader(DBInputFormat.DBInputSplit split,
    Class<T> inputClass, Configuration conf, Connection conn,
    DBConfiguration dbConfig, String cond, String [] fields,
    String table) throws SQLException {

  super(split, inputClass, conf, conn, dbConfig, cond, fields, table,
      "ORACLE");

  // Must initialize the tz used by the connection for Oracle.
  OracleDBRecordReader.setSessionTimeZone(conf, conn);
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:12,代码来源:OracleDataDrivenDBRecordReader.java

示例2: createDBRecordReader

import com.cloudera.sqoop.mapreduce.db.OracleDBRecordReader; //导入依赖的package包/类
protected RecordReader<LongWritable, T> createDBRecordReader(
    com.cloudera.sqoop.mapreduce.db.DBInputFormat.DBInputSplit split,
    Configuration conf) throws IOException {

  @SuppressWarnings("unchecked")
  Class<T> inputClass = (Class<T>) (dbConf.getInputClass());
  try {
    // use database product name to determine appropriate record reader.
    if (dbProductName.startsWith("ORACLE")) {
      // use Oracle-specific db reader.
      return new OracleDBRecordReader<T>(split, inputClass,
          conf, getConnection(), getDBConf(), conditions, fieldNames,
          tableName);
    } else if (dbProductName.startsWith("DB2")) {
      // use DB2-specific db reader.
      return new Db2DBRecordReader<T>(split, inputClass,
          conf, getConnection(), getDBConf(), conditions, fieldNames,
          tableName);
    } else {
      // Generic reader.
      return new DBRecordReader<T>(split, inputClass,
          conf, getConnection(), getDBConf(), conditions, fieldNames,
          tableName);
    }
  } catch (SQLException ex) {
    throw new IOException(ex);
  }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:29,代码来源:DBInputFormat.java


注:本文中的com.cloudera.sqoop.mapreduce.db.OracleDBRecordReader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。