code: public static long firstLongKey(PreparedStatement stmt) throws SQLException {
  		stmt.execute();
  		ResultSet rs = stmt.getGeneratedKeys();
  		long key = rs.next() ? rs.getLong(1) : 0L;
  		stmt.close();
  		return key;
  	}
docs: Execute the insert statement, get the first generated key as a long, 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