Re: Generic Oracle DB Mngr
- From: Arto Viitanen <arto.viitanen@xxxxxx>
- Date: Thu, 19 Jan 2006 13:45:14 +0200
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
.
- Follow-Ups:
- Re: Generic Oracle DB Mngr
- From: 0rac1..e
- Re: Generic Oracle DB Mngr
- References:
- Generic Oracle DB Mngr
- From: 0rac1..e
- Generic Oracle DB Mngr
- Prev by Date: Generic Oracle DB Mngr
- Next by Date: Re: java long in an Access database
- Previous by thread: Generic Oracle DB Mngr
- Next by thread: Re: Generic Oracle DB Mngr
- Index(es):