public void glGetQueryObjectuiv(int id, int pname, int params, int params_offset)
works fine when you expect the result on params.
But there is one option when this is not the case, https://www.opengl.org/sdk/docs/man/html/glGetQueryObject.xhtml
"If a buffer is bound to the GL_QUERY_RESULT_BUFFER (they mean GL_QUERY_BUFFER) target, then params is treated as an offset to a location within that buffer's data store to receive the result of the query. If no buffer is bound to GL_QUERY_RESULT_BUFFER (GL_QUERY_BUFFER), then params is treated as an address in client memory of a variable to receive the resulting data. "