• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

PreparedStatement Objects vs MyBatis

 
Ranch Hand
Posts: 224
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it more preferable to use a PreparedStatement object for sending SQL statements to the database or making calls to stored procedures through MyBatis? Under which conditions would one be more preferable than the other?
 
Bartender
Posts: 1164
38
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally speaking, using SP allows you to achieve better performance when you need to execute more statements in cascade to fulfill some task. Otherwise, I guess that executing a single PS or calling a SP that execute only a single operation is pretty the same thing - one noticeable difference is that the code of a SP  could be changed on the fly, while Java code needs to be redeployed.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!