Sometime packaging all the sql into a procedure helps us to get rid of the usual Oracle/SQL OTD bugs. The smartest way is to collect all the information which we require in a jcd and then trying to write an optimized query which fetches the results as per out requirement.
Doing such tasks with the help of Oracle/SQL OTD Wizard looks easy initially but can be painful and tedious in case change-requests drops to your email after completion of the first phase of your project :)
Following example illustrates how we can call a procedure from JCD:
Writing and executing sql queries/ procedure calls in Collaboration in core java gains a lot of flexibity in terms of changes later on. Also we can create dynamic queries which i feel is not possible to create with the help of Oracle/SQL OTD.
Labels: best practises, Calling procedure from jcaps, connection, Interview Questions on SUN JCAPS(submitted by Manesh Koovappillil), jcaps procdure, oracle, package procedure, procedure, sql |