Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When not to use PreparedStatement

 
raj malhotra
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic