I have read about PreparedStatement and Statement's performances too.
and i wanted to see the difference byself.
So in oracle db i've created a table having 2 numbers and 1 varchar column.
And i ran an insert sql into
test table in a loop of 5000 times.
and i measured the time with System.currentTimeMillis();
before and after the loop to demonstrate PreparedStatement had better performance.
I tested it several times.
At first Statement finished jobs with the 89 secs.
PreparedStatement finished with 49 seconds.
as i told i tested it several times.
then more and more Statement closed the difference of time
between PreparedStatement.
Can any body explain this stuation?
My friend That he doesnt understand any
java but he knows oracle very well explained me that with "oracle forms" if an sql statement sent to db then it compiles it only for once and executes the compiled sql if asked for again...
Does oracle do some trick at db side to reduce the compilation time?
??
[ July 07, 2005: Message edited by: rasit fidanov ]