for example:
Connection conn = null; PreparedStatement sth = null; ResultSet rs =null; try { conn = delegate.getConnection(); sth = conn.prepareStatement(INSERT_SQL); sth.setString(1, pais.getNombre()); sth.executeUpdate(); rs=sth.getGeneratedKeys(); if(rs.next()){ Integer id = (Integer) rs.getInt(1); pais.setId(id); } }
with ,Statement.RETURN_GENERATED_KEYS);"
no found.