• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple statements or in a stored proc

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
What is a better apporach to have in a scenario where i have 10 DML (ins/upd/del)to execute.
Whether to use 10 individual statements or have all of them in one stored proc

Rgrds
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution depends on the architecture of your application. I prefer keeping it in the Java (10 statements), but there are times where you'd use a procedure as well.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34695
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manish,
You could use JDBC to batch the 10 statements into one database trip. This would provide most of the advantages of a stored procedure while keeping all the code in java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic