Hi Cornelius,

----- Original Message -----
From: "Cornelius Keller" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, March 02, 2003 5:00 AM
Subject: Re: OJB 0.9.9 & mysql: Database User & password form repository
not used?


> Yes thats solves the Problem,
>
> but then I have to recompile if I want to change the Database
settigns, and
> One of the reaseons for using OJB is that i dont want to.
> Any other Solutions so that OJB uses the user and Password defined in
the
> repository_databases.xml?
>
> I am clling
PersistenceBrokerFactory.createPersistenceBroker("default");

If you set the 'default-connection' attribute
to 'true' (and set user/password) in your jdbc-connection-descriptor,
it's possible to lookup the PB with

PersistenceBrokerFactory.defaultPersistenceBroker();

or you could use

PersistenceBrokerFactory.createPersistenceBroker(new PBKey("default"));


If you got problems using PBKey("default"), there is a small bug
in 0.9.9. Fix is in CVS.
More info and how to patch under

http://archives.apache.org/eyebrowse/[EMAIL PROTECTED]
pache.org&msgNo=5507


HTH
regards,
Armin

>
> Thank you
>
>
> > Here is what I use for fetching a PersistenceBroker in my code:
> >
> > PersistenceBroker broker =
> > PersistenceBrokerFactory.createPersistenceBroker(new
> > PBKey("default","sa",""));
> >
> > Where "sa" equals a user id and "" is the password.
> >
> > Hope this info helps,
> >
> > Jeff
> >
> >
> > On Saturday 01 March 2003 06:19 pm, you wrote:
> > > Hello List,
> > >
> > > I am using the following Connection descriptor:
> > >
> > > <jdbc-connection-descriptor
> > >      jcd-alias="default"
> > >      default-connection="true"
> > >      platform="MySQL"
> > >      jdbc-level="2.0"
> > >      driver="org.gjt.mm.mysql.Driver"
> > >      protocol="jdbc"
> > >      subprotocol="mysql"
> > >      dbalias="//localhost:3306/fldb?autoReconnect=true"
> > >      username="root"
> > >      password="x"
> > >      batch-mode="false"
> > >
> > >
> > > When creating a Persistence Broker, I am reciving the follwoing
> Exception :
> > >
> > > General error: Access denied for user: '@localhost' to database
'fldb'
> > > java.sql.SQLException: General error: Access denied for user:
> '@localhost'
> > > to database 'fldb'
> > >         at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497)
> > >         at
> org.gjt.mm.mysql.Connection.connectionInit(Connection.java:264)
> > >         at
> > >
org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
> > >         at org.gjt.mm.mysql.Driver.connect(Driver.java:167)
> > >         at
java.sql.DriverManager.getConnection(DriverManager.java:512)
> > >         at
java.sql.DriverManager.getConnection(DriverManager.java:193)
> > >         at
> > >
>
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConne
cti
> > >o nFromDriverManager(Unknown Source)
> > >         at
> > >
>
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConPoolFac
tor
> > >y .makeObject(Unknown Source)
> > >         at
> > >
>
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjec
tPo
> > >o l.java:710)
> > >         at
> > >
>
org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.getConnect
ion
> > >F romPool(Unknown Source)
> > >         at
> > >
>
org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupCo
nne
> > >c tion(Unknown Source)
> > >         at
> > >
>
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Un
kno
> > >w n Source)
> > >         at
> > >
>
org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(Unkno
wn
> > > Source)
> > >         at
> > >
>
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.beginTransaction(Un
kno
> > >w n Source)
> > >         at
> > >
>
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.beginTransact
ion
> > >( Unknown Source)
> > >         at com.ckeller.flweb.application.FLApp.login(Unknown
Source)
> > >      .......
> > >
> > >
> > > When Creating a the first PersistenceBroker.
> > > Why is OJB using the Databese and and url defined in the
repository but
> not
> > > the username and password?
> > >
> > > I just updated from OJB 0.9.7 to 0.9.9, in 0.9.7 my database setup
> worked
> > > well.
> > > What am I doing wrong now?
> > >
> > > Thanks in Advance for your Time
> > > - Cornelius
> > >
> > >
> > >
> > >
> > >
> > > --------------------------------------------------------------
> > > Cornelius Keller
> > > Stud. Inf.
> > > Humbold Universit�t Berlin
> > > ---------------------------------------------------------------
> > > crewmeber of space station C-Base -
> > > culture communication carbonite in berlin
> > > visit: http://www.c-base.org/
> > > ---------------------------------------------------------------
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>


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

Reply via email to