code: public static int firstIntKey(PreparedStatement stmt) throws SQLException {
  		stmt.execute();
  		ResultSet rs = stmt.getGeneratedKeys();
  		int key = rs.next() ? rs.getInt(1) : 0;
  		stmt.close();
  		return key;
  	}
docs: Execute the insert statement, get the first generated key as an int, and close the statement.
  
  @param stmt
  must have been created with {@link Statement#RETURN_GENERATED_KEYS} and already
  have parameters set
  @return 0 if the statement did not generate any keys
  @since 3.0.0