-2

I am developing java applications and they all communicate with MySQL database server (getting some data, writing some data etc). In my java code i am executing statements and prepared statements to do it. I want to optimize my applications and get better execution times.

I want to know more about stored-procedures. I want to know the difference between statements, prepared-statement and stored procedures and their advantages and disadvantages, when is better to use either of them.

AdrianES
  • 670
  • 3
  • 13
  • 29
  • http://stackoverflow.com/questions/3271249/difference-between-statement-and-preparedstatement – Damodaran Jan 23 '14 at 10:18
  • http://stackoverflow.com/questions/7296417/difference-between-stored-procedures-and-prepared-statements – Damodaran Jan 23 '14 at 10:19
  • I've read the exact same posts, just before i ask this question, you don't need to be rude! I wanted to know something more about it. For example, what is better to use, for simple select all statement, if i had to find some records in huge table, etc. I am more interested of the performance of each in different scenarios. – AdrianES Jan 23 '14 at 10:29

1 Answers1

1

They will each have different initialization times because MySql will parse each type of call differently to create the plan. After thet (for comparison purposes) they will all have the same plan and execution time will be the same from then on.

Ted Bigham
  • 4,237
  • 1
  • 26
  • 31