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