tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael G. Anderson C.T.O." <>
Subject Re: Really Offtopic - Resultsets from Oracle stored proc
Date Fri, 17 Nov 2000 01:00:56 GMT
Here is something that I had to write up for a recruiter to test the knowledge of
Web Architect/DBA candidates....
I never got a thank you either :(

Perhaps I made an error in these Q&As...

Begin here:********************

Q: Please write 2 lines of  'java' code that will execute an "Oracle stored
Procedure" called SHOW_SUPPLIERS. <assume the code will be in a servlet.>

A: CallableStatement cs = con.prepareCall("{call SHOW_SUPPLIERS}");
     ResultSet rs = cs.executeQuery();

If he/she writes this exactly -- he/she is probably tour 'candidate' Note: they
must have the "curly braces" in the command.
i.e. The part that is enclosed in curly braces is the escape syntax for stored
procedures. and the java code is "case-sensitive"

Q: Ask the candidate what class is "CallableStatement" subclassed from?
A: The class CallableStatement is a subclass of PreparedStatement.

Aside from having a mastery over PL/SQL (I mean he/she really better know PL/SQL)
ask them:

Q: What are the advantages of dynamic SQL?
A:  In practice, static SQL will meet nearly all  programming needs. Use dynamic
SQL only if  its open-ended flexibility is needed. Its use is suggested when one of

the following items is unknown at precompile time:

     1) text of the SQL statement (commands, clauses, and so on)

     2) the number of host variables

     3) the datatypes of host variables

     4) references to database objects such as columns, indexes, sequences, tables,

usernames, and views

End here:********************


mike anderson

> Hi,
>     I apologise for this offtopic message...
>     Does anyone know how to retrieve a RecordSet (using CallableStatement) from
> an ORACLE stored procedure ?
>     Can you point me to documentation/HOWTOs ?
>     Thanks,
> diego.

View raw message