Update DBOutputFormat.java

This commit is contained in:
Peeb 2015-03-24 19:30:33 +08:00
parent e66eb382b1
commit 5ae1222f83
1 changed files with 3 additions and 3 deletions

View File

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