提交 0a7b6885 authored 作者: noelgrandin's avatar noelgrandin

since we're not calling findColumn anymore we don't need the catch block

上级 34e3c903
......@@ -122,21 +122,17 @@ public class DbContents {
* @param defaultColumnIndex the default column index
* @return the column index
*/
public static int findColumn(ResultSet rs, String columnLabel, int defaultColumnIndex) {
try {
// don't use ResultSet.findColumn because that would throw an
// exception, and we don't want to use exception handling for flow
// control
ResultSetMetaData meta = rs.getMetaData();
for (int i = 1; i <= meta.getColumnCount(); i++) {
if (meta.getColumnLabel(i).equalsIgnoreCase(columnLabel)) {
return i;
}
public static int findColumn(ResultSet rs, String columnLabel, int defaultColumnIndex) throws SQLException {
// don't use ResultSet.findColumn because that would throw an
// exception, and we don't want to use exception handling for flow
// control
ResultSetMetaData meta = rs.getMetaData();
for (int i = 1; i <= meta.getColumnCount(); i++) {
if (meta.getColumnLabel(i).equalsIgnoreCase(columnLabel)) {
return i;
}
return defaultColumnIndex;
} catch (SQLException e) {
return defaultColumnIndex;
}
return defaultColumnIndex;
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论