aspose file tools*
The moose likes JDBC and the fly likes When not to use PreparedStatement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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
 
 
subject: When not to use PreparedStatement