Use the Ninja build system and set BUILD_JDBC=1:
GEN=ninja BUILD_JDBC=1 make
Run the tests:
java -cp ./build/release/tools/jdbc/duckdb_jdbc.jar org.duckdb.test.TestDuckDBJDBC
pragma enable_profiling;
Then, simply run the query. No additional keyword is required.
See also the documentation on runtime profiling.