本文整理匯總了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);
}
}