This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
calendar does not influence a thing. Doh I realy don't need it.
I thought of that before an removed from code:
and got sql_execution_time = 0
Note, tat some sql-s via heidi take like 0,1 s, via java code 1s. Hence I went doing this test, otherwise I have some connection pooling.
So, it is sure thing that problem is somewhere in ResultSet rs = stm.executeQuery(sql);
Joined: Nov 23, 2010
So I made my own connection pooling, just to be sure that each time I run the code I use same connection, that is opened just first time and remains opened.
Each time I run above code I get(+/- 2 ms on each number ofcourse):
There you go. So you made one of the common errors in benchmarking, namely failing to run things several times so that you don't measure start-up costs like classes being loaded. Now that you have fixed that, you can make a better comparison.