If I have a simple query that can be execute in one shot, like select name from table, a stored procedure does not provide additional benefits.[/QB]
I like stored procs for the following reason:
1) They can be tested independently of
java code, simply by using a standard SQL query tool
2) They can be maintained by non-java developers
3) They can be easily reused in other languages besides java.
4) They can easily be accessed from other Java applications
5) They hide the implementation and table structure from the java code (i.e. the java code only knows what they do, not how they do it)
6) They often offer better performance
The biggest reason people don't like them is that often the code in them is database dependent. But, in my experience most people don't stick to ANSI code in their sql anyway. I would hide the fact the fact that I am using stored procs (or straight sql for that matter) in an abstraction layer.
steve -
http://www.fdsapi.com - the easiest way to render result sets as html and xml.