Re: Generic Oracle DB Mngr



0rac1..e wrote:
Can anyone point me (share code) to a Java wrapper (aka DB-Mngr, aka
data access object) that supports a call to Oracle SPs.

Something that would basicly implement:

Interface DatabaseMgnr
{
 //supports select
 ResultSet ExecSP(String pKgAndprocName, Collection parameters);

//supports update\insert\delete
void ExecSP(pKgAndprocName, Collection parameters); }



That is a faq, for example from http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#34_01

you can use either SQL92 syntax or Oracle syntax:

 * SQL92 Syntax

CallableStatement cs1 = conn.prepareCall ("{call proc (?,?)}");
CallableStatement cs2 = conn.prepareCall ("{? = call func (?,?)}");

 * Oracle Syntax

CallableStatement cs1 = conn.prepareCall ("begin proc (:1,:2); end;");
CallableStatement cs2 = conn.prepareCall ("begin :1 := func (:2,:3); end;");


You can then build Java method that reflects the stored procedure.

--
Arto Viitanen, CSC Ltd
Espoo, Finland


.