/** * Return a result set that contains the last generated auto-increment key for this connection, if * there was one. If no key was generated by the last modification statement, then an empty result * set is returned. The returned result set only contains the data for the very last row. * * @return the result set with one row and one column containing the key * @throws SQLException if this object is closed */ public ResultSet getGeneratedKeys() throws SQLException { try { int id = getNextId(TraceObject.RESULT_SET); if (isDebugEnabled()) { debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "getGeneratedKeys()"); } checkClosed(); return conn.getGeneratedKeys(this, id); } catch (Exception e) { throw logAndConvert(e); } }
/** * Return a result set that contains the last generated autoincrement key for this connection. * * @return the result set with one row and one column containing the key * @throws SQLException if this object is closed */ public ResultSet getGeneratedKeys() throws SQLException { try { int id = getNextId(TraceObject.RESULT_SET); if (isDebugEnabled()) { debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "getGeneratedKeys()"); } checkClosed(); ResultInterface result = conn.getGeneratedKeys(); ResultSet rs = new JdbcResultSet(conn, this, result, id, false, true, false); return rs; } catch (Exception e) { throw logAndConvert(e); } }