aspose file tools
The moose likes JDBC and the fly likes When not to use PreparedStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "When not to use PreparedStatement" Watch "When not to use PreparedStatement" New topic
Author

When not to use PreparedStatement

raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
Hi Can anyone clarify the below quote from this

Sometimes prepared statements can actually be slower than regular queries. The reason for this is that there are two round-trips to the server, which can slow down simple queries that are only executed a single time.


At what point of time this two round-trips happens?

thanks
Raj
[ December 18, 2008: Message edited by: raj malhotra ]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I'd ignore the comment. In practice the compilation time for a one-off statement is unlikely to impact your application, where compiling the same statement millions of times will.
raj malhotra
Ranch Hand

Joined: Feb 22, 2007
Posts: 285
thanks David
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: When not to use PreparedStatement
 
Similar Threads
Bulk Data Processing
hibernate cache
How to compare two queries based on efficiency
Alternative to JavaScript?
running java app as a batch job