• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Only one question in Stored procedure.

 
Shanmugam nagaraj
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What is the scenario we will use the stored procedure?

I understand that will improve the performance while use the stored procedure and also reduce the application overload.

My Question is like:

1) Even though we use the database connection in our application for using the stored procedure right?

2) Why we are not using like simply connecting to database and execute in the application it self?

Please explain me in detail so I can understand it properly.

Thanks

Shanmugam
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I understand that will improve the performance while use the stored procedure and also reduce the application overload.

It might do. It will shift the performance overhead from the application to the database, plus (depending on how you implement your SPs) it can wrap operations that would need multiple round tiprs from applciation to database into one trip.


1) Even though we use the database connection in our application for using the stored procedure right?

Not sure what you mean here. Are you asking, do we still need to connect to the database to use the procedure? Yes - how else can you access a database resource?


2) Why we are not using like simply connecting to database and execute in the application it self?

Executing in the applciation? Again, not sure what you mean here. You can't execute stored procedures in the applciation, they are exclusively database objects.
 
Shanmugam nagaraj
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi paul,

This is the excellent explanation that what I expected.

Thanks paul...



2) Why we are not using like simply connecting to database and execute in the application it self?

----------------------------------------------------------------------------


Executing in the applciation? Again, not sure what you mean here. You can't execute stored procedures in the applciation, they are exclusively database objects.

-----------------------------------------------------------------
I mean here like, we can also just make database connection and use the statement object to execute our simple query thru our java application right, then what is the need for the Stored procedure.

For each and every query this also hit the database to do the operations, please explain me in detail

Thanks
Shanmuam N
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you process the procedure from the application end?

That introduces tight coupling between the database and the distant application; if there is any change in the structure (logical schema) of the DB, any applications using that DB have to be altered. A source of excess work expense and scope for errors.
 
Sasikanth Malladi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a wealth of information regarding your question.

Google for "benefits/advantages of stored procedures" and you should see some very useful results.

Sashi
 
Jan Cumps
Bartender
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google for "disadvantages of stored procedures" and you will also get useful results.

Regards, Jan
 
Shanmugam nagaraj
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow..
The answer you replied is really cleared my doubts in stored procedure

Thanks to all....
meet you soon with another question be ready ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic