You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Torsten Schlabach <TS...@gmx.net> on 2003/05/20 13:47:34 UTC

How to obtain the JDBC Connection?

Dear List,

how would I navigate from a PersistenceBroker instance to get a
java.sql.Connection?

Someone on the list suggested
this:

PersistenceBrokerFactory.createPersistenceBroker().getConnectionManager().getConnection();

Won't work as it has to be at
least

PersistenceBrokerFactory.createPersistenceBroker(PersistenceBrokerFactory.getDefaultKey()).getConnectionManager().getConnection();

But then the Method getConnectionManager() on PersistenceBroker does not
exist or does not exist any more.

Any hints are welcome.

Torsten


Re: How to obtain the JDBC Connection?

Posted by Armin Waibel <ar...@code-au-lait.de>.
See FAQ

http://db.apache.org/ojb/faq.html

regards,
Armin

----- Original Message -----
From: "Torsten Schlabach" <TS...@gmx.net>
To: <oj...@db.apache.org>
Sent: Tuesday, May 20, 2003 1:47 PM
Subject: How to obtain the JDBC Connection?


> Dear List,
>
> how would I navigate from a PersistenceBroker instance to get a
> java.sql.Connection?
>
> Someone on the list suggested
> this:
>
>
PersistenceBrokerFactory.createPersistenceBroker().getConnectionManager(
).getConnection();
>
> Won't work as it has to be at
> least
>
>
PersistenceBrokerFactory.createPersistenceBroker(PersistenceBrokerFactor
y.getDefaultKey()).getConnectionManager().getConnection();
>
> But then the Method getConnectionManager() on PersistenceBroker does
not
> exist or does not exist any more.
>
> Any hints are welcome.
>
> Torsten
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



Re: How to obtain the JDBC Connection?

Posted by Michael Schulze <mi...@t-systems.com>.
Try serviceConnectionManager() instead of getConnectionManager() on the
PersistenceBroker.

On Tue, 2003-05-20 at 13:47, Torsten Schlabach wrote:
> how would I navigate from a PersistenceBroker instance to get a
> java.sql.Connection?
> 
> Someone on the list suggested
> this:
> 
> PersistenceBrokerFactory.createPersistenceBroker().getConnectionManager().getConnection();
> 
> Won't work as it has to be at
> least
> 
> PersistenceBrokerFactory.createPersistenceBroker(PersistenceBrokerFactory.getDefaultKey()).getConnectionManager().getConnection();
> 
> But then the Method getConnectionManager() on PersistenceBroker does not
> exist or does not exist any more.



Re: How to obtain the JDBC Connection?

Posted by Thomas Mahler <th...@web.de>.
have a look at this sample code:
http://cvs.apache.org/viewcvs/db-ojb/src/test/org/apache/ojb/broker/PerformanceJdbcReferenceTest.java?rev=HEAD&content-type=text/vnd.viewcvs-markup

Torsten Schlabach wrote:
> Dear List,
> 
> how would I navigate from a PersistenceBroker instance to get a
> java.sql.Connection?
> 
> Someone on the list suggested
> this:
> 
> PersistenceBrokerFactory.createPersistenceBroker().getConnectionManager().getConnection();
> 
> Won't work as it has to be at
> least
> 
> PersistenceBrokerFactory.createPersistenceBroker(PersistenceBrokerFactory.getDefaultKey()).getConnectionManager().getConnection();
> 
> But then the Method getConnectionManager() on PersistenceBroker does not
> exist or does not exist any more.
> 
> Any hints are welcome.
> 
> Torsten
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
>