The point of the assignment was to introduce you to a real application example that compares the performance characteristics of a pre-compiled language C
to a just-in-time (JIT) interpreted^ language Java
.
^The difference between interpreted and compiled code is a pedantic
argument, truthfully all code is interpreted at runtime; even assembly
is converted to machine language at runtime, and machine language
resolves to memory addresses and CPU instructions.
The important distinction here is pre-compiled vs JIT. The difference
is how close the code gets to machine code at build-time vs run-time.
C gets closer at build-time ( for the most part, ignoring recent
advances in heuristic compilation in Java).
This assignment scenario adds in the realistic complication of database data retrieval, which partly serves to increase the numbers so you have something to work with, but mostly to accentuate that the program time consists of fixed (start up) and variable (in this case I/O bound) phases. It could also have been a CPU-bound example, the same pattern would have emerged.
It starts to be easier to see if you graph the values in a chart.

Look at the slope of the two lines. I think it's an anomaly that in your numbers the C program is slower over 4000+ records, but that's not important and should not distract from the core point of the example.
- The C app starts with 100 rows in 76ms, quite close to the origin at 0
- The Java app starts at 586ms, quite close to 500.
The C app startup time is negligible so can be effectively ignored.
The Java app startup time, on the other hand, is around 500ms. It is the JIT compiler interpreting the Java bytecode on the Java Virtual Machine (JVM); it's a fixed start-up cost that you pay for each run of the code no matter how much data you retrieve from the database.
You can consider that 500ms to be the real origin of your data access times, and see that the program grows linearly from that 500ms point.
It is not the drivers JDBC vs ODBC per say, however, the JDBC driver is also a Java library that is effectively an extension of your program and subject to the same JIT, similarly the ODBC driver is also pre-compiled C library that is effectively an extension of your program. It wouldn't be fair to blame the drivers specifically (assuming they are both optimized) it is more about the application context as a whole.