Not sure I know what you really want, but if this is a testing phase sort of thing and you are running on unix, there is the time command.
If you want something that is part of your application, you can run a timer in a separate Thread - for approximate time.
If you want more precise time, you can use java.util.Date - it has a method getTime(), which you can use before processing and again after processing and subtract the former from the later.
> which excludes network access
Any measurement you take in your Java/JDBC code will be the sum of the network access and the query execution time. You will not be able to separate the two numbers. If you want only the query execution time, you must measure that in your database server.
That makes your question a question about your database, not about Java or JDBC.