代码: stmt = conn.createStatement(); for (String sql : sqlStr) { stmt.addBatch(sql); } stmt.executeBatch(); rs = stmt.getGeneratedKeys();
异常: java.sql.SQLException: Generated keys not requested. You need to specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate(), Statement.executeLargeUpdate() or Connection.prepareStatement().