列挙型に一致するものを探したい: Divisions:U6,U7,U8... これを行うと機能します。
public ArrayList<Training> zoekTrainingen(Ploegen p) throws
ApplicationException {
ArrayList<Training> tr = new ArrayList<>();
Connection conn = ConnectionManager.getConnection(driver,
dburl, login, paswoord);
try (PreparedStatement stmt = conn.prepareStatement(
"select * from trainingen");) {
stmt.execute();
ResultSet r = stmt.getResultSet();
while (r.next()) {
---
}
} catch (SQLException sqlEx) {
throw new ApplicationException("");
}
finally {
return tr;
}
}
}
しかし、私がこれを行うと:
try (PreparedStatement stmt = conn.prepareStatement(
"select * from trainingen where Divsion = ?");) {
stmt.setString(1, p.getDivision());
何も得られない