ResultSet.findColumn() is not compliant with API.
The API states that findColumn() throws SQLException if the column is not found. However, a SQLGrammarException is thrown, breaking the API.
Simple test:
try {
String testQuery = "SELECT 0";
PreparedStatement testStmt = connection.prepareStatement(testQuery);
ResultSet rs1 = testStmt.executeQuery();
rs1.findColumn("dummycolname");
} catch (SQLGrammarException e) {
throw new IllegalStateException("Wrong Exception", e);
} catch (SQLException e) {
// Correct exception
}
|