View Single Post

  #4 (permalink)  
Old 08-24-2004, 12:37 AM
akpraveen
 
Posts: n/a
Re:Difference between Statement and Callable Stmt.

Banu\'s \"Back Again!\".. Awesome!

\"Why do you need a Callable Statement when you can use a getter method of a Prepared Statement ResultSet object to retrieve column data?\"

Like Vasu garu pointed out, Callable Statements are to be used in the event you use stored procedures to perform database queries! In large production environments, the goal/outcome of a development initiative is reusability. Stored procedures are a way for the database analyst/administrator to provide
a layer of abstraction for applications using the database (This responsibility is seldom borne by the DB Group). Nonetheless, your concept of using getter methods in the Resultset object will work fine if you have one resultset (which is normally the object returned after executing one SQL query). CallableStatements can be invoked to return multiple Resultset objects through stored procedures. Hence, to identify these multiple
ResultSet Objects, you would require a way to identify the output parameters/variables (Which are these ResultSet Objects).
To do so, you require CallableStatements!


HTH
Reply With Quote