Update DBOutputFormat.java

This commit is contained in:
Peeb 2015-03-24 19:30:33 +08:00
parent e66eb382b1
commit 5ae1222f83

View File

@ -100,14 +100,14 @@ public void close(TaskAttemptContext context) throws IOException {
catch (SQLException ex) {
LOG.warn(StringUtils.stringifyException(ex));
}
throw new IOException(e.getMessage());
throw new IOException(e);
} finally {
try {
statement.close();
connection.close();
}
catch (SQLException ex) {
throw new IOException(ex.getMessage());
throw new IOException(ex);
}
}
}
@ -182,7 +182,7 @@ public RecordWriter<K, V> getRecordWriter(TaskAttemptContext context)
constructQuery(tableName, fieldNames));
return new DBRecordWriter(connection, statement);
} catch (Exception ex) {
throw new IOException(ex.getMessage());
throw new IOException(ex);
}
}