Venu Gopal wrote:
>
> Hi Karau,
>
> Thanks for your reply..
>
> I need to know a bit more on this..
>
> 1. Which one will perform better in terms of getting
> data from the database? The stored procedure one or
> the JDBC query one?
The stored procedure is supposedly better in performance.
> 2. Will the stored procedure once executed need not be
> executed again unlike the ordinary JDBC query (which
> execute every time the program is invoked).
Nope it works just as any query, it's just precompiled and optimized.

> 3. What is the difference between prepared statement
> (which is also a compiled SQL statement??) & stored
> procedure?
A Prepared Statement is something like any other query, but it's send to
the rdbms to be precompiled and optimized and then awaits the parameters
to be set after which it can be executed. It's faster in case you call
the same query over and over again (using the same connection) ex when
you're populatint the db with lot's of records. There might not be much
of a preformance difference when you're using a simple select or update
statement on one record and then close the connection or return it to
the connection pool.

sven

--
======================================================================================
Sven E. van 't Veer
http://www.cachoeiro.net
Java Developer                                                      [EMAIL PROTECTED]
======================================================================================

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to