Hi Luc,

PersistenceBroker pb = ... /* however you get your PB */
pb.beginTransaction(); // This will associate a connection with the pb
java.sql.Connection connection =
pb.serviceConnectionManager().getConnection();

/* Do your stuff */

pb.commitTransaction(); // This will close/return the underlying connection
to the pool


HTH,

Charles.


-----Original Message-----
From: Luc Fouin [mailto:[EMAIL PROTECTED]
Sent: 11 August 2005 11:40
To: [email protected]
Subject: Getting the datasource of the mapping...


hi all,

i've got a mapping with a set of objects. i've also got in the same 
database datas which are not mapped to an object (because they are just 
here for analysis and d'ont need to be instanciated...)

my goal is to query the database using a SQL Query. I can't use OQL 
(QueryByCriteria or QueryBySql) because there's no mapping on those datas.

First i tried a method which could take my query, and i did not found that.
So my second point is to try to get the datasource corresponding to the 
mapping (to avoid redundancy of the parameters) and to pass my query by 
classic jdbc...

is this possible to get a datasource from the persistenceborker??

(I see a third solution by setting a jndi datasource which will be 
called by the mapping and by me, but it seems to me a little more 
complicated...)

thanks a lot... (please tell me if i'm not clear!)

Luc

-- 
Luc FOUIN - Stagiaire Aptiwan
14 rue Niepce
75014 Paris
Tél : (+33) 6 77 95 17 24
Mél : luc*DOT*fouin*AT*aptiwan*DOT*com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



___________________________________________________________
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]

Reply via email to