> > From: Thomas Dudziak [mailto:[EMAIL PROTECTED] > Sent: 03 May 2006 15:55 > > > On 5/3/06, Anjishnu Bandyopadhyay <[EMAIL PROTECTED]> wrote: > > > I am looking for an alternative to the implementation of > > "CallableStatement" Java API. > > If you want to insert/update/delete a Java object (or more precisely, > its data in the database) with this stored procedure, then Antonio's > pointer is correct. > If however this has nothing to do with actual objects, but rather you > want some plain data, then you should use raw SQL queries > (http://db.apache.org/ojb/docu/guides/query.html#Query+Criteria). > > Tom >
In addition to Tom & Antonios comments, if you simply wish to call a pre-existing stored procedure on the same jdbc connection as your broker , you could do something like this // Get or create the broker in your normal way PersitenceBroker broker = ... broker.beginTransaction(); broker.store(aThing); Connection conn = broker.serviceConnectionManager().getConnection(); CallableStatement stmt = conn.prepareCall("call Upload_Data()"); stmt.executeQuery(); stmt.close; broker.commitTransaction(); broker.close(); Here the aThing will be stored in the same trasaction as the upload_data stored procedure, and will be committed or rolled back in one fell swoop. There is nothing OJB, though, to wrap around the calling of the stored procedure. HTH, Charles. ___________________________________________________________ HPD Software Ltd. - Helping Business Finance Business Email terms and conditions: www.hpdsoftware.com/disclaimer --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]