PDA

View Full Version : Oracle SQLJ limitation with java.sql.ResultSet input parameter ...


Giovanni Azua
12-07-2004, 04:53 AM
Hello all,

I have a PL/SQL API which I call from a Java J2EE business
layer, instead of running any SQL statement (directly or
indirectly e.g. EJB-SQL) from any of my Java tiers.

One of the PL/SQL API functions purpose is to return to the
business layer the results of a query, a REF CURSOR i.e.
sys_refcursor which is a very handy, reusable and scalable
way to send results to Java, then my Java DAO classes (using
JPublisher generated SQLJ as basement) on the business layer
take care of transforming the java.sql.ResultSet into Data
Transfer Objects which are finally sent to the presentation
tier, and this works ok.

Now I have a new requirement which is that every execution of
that PL/SQL API function should be logged for auditing purposes,
the log must include input parameters to the API as well as
some of the results i.e. few top records.

This became a problem because I can not fetch any records from
PL/SQL otherwise would have to reopen the cursor which means
executing twice! I also tried creating yet another PL/SQL API
function exactly for that purpose of logging and trying to
send java.sql.ResultSet from Java as input parameter to PL/SQL
is not supported by SQLJ (JPublisher generated files).

I would not like to make any exceptions with the PL/SQL API
(not using SQLJ), neither execute any SQL from Java, and still
not have to create yet another kind of Transfer Object type (Oracle
object type) which would sum up to the DAO coupling to Oracle
just for passing aggregated parameters from Java to Oracle e.g.

Any ideas?

Thanks in advance,
Best Regards,
Giovanni

PS: I appologize for the cross-post but there is not this
specialized which group about Oracle SQLJ.


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service