Preparedstatement java
<p>I want to look for something that matches a enum: Divisions:U6,U7,U8...
It works when i do this.</p>

<pre><code>public ArrayList&lt;Training&gt; zoekTrainingen(Ploegen p) throws
        ApplicationException {

    ArrayList&lt;Training&gt; tr = new ArrayList&lt;&gt;();
    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;
    }
}

    }
</code></pre>

<p>but when I do this:  </p>

<pre><code>try (PreparedStatement stmt = conn.prepareStatement(
            "select * from trainingen where Divsion = ?");) {
            stmt.setString(1, p.getDivision()); 
</code></pre>

<p>I get nothing</p>
