Originally posted by parul patidar: or none of the way is efficient?
they are different, but are both inefficient. The firstStatement:
will reuse the same memory address for each iteration through the while statement. the second statement:
will create a new object in memory for each iteration. Performance: both of the above use statements, which means that in each iteration it has to create the statement object, then compile it, then eventually execute it. Better performance:
will create only one object in memory and reuse it for each iteration. If you use PreparedStatement instead, you can create an object once, compile it once, then reuse it. eg.
The best performance: use preparedStatements with BatchUpdates.(only applicable to some JDBC drivers). Jamie
Joined: Sep 07, 2001
thanx u really helped a lot
Originally posted by Jamie Robertson: [B] will create only one object in memory and reuse it for each iteration. [/CODE] Jamie[/B]
can i use same statement to fire more than one sql commands