Hi,

which version do you use?
I think
PBKey key = new PBKey("conn2");
should work (test it with CVS head + hsql).
Maybe the empty string for password is
the problem.

regards,
Armin

----- Original Message -----
From: "Ismail Siddiqui" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 22, 2003 7:41 PM
Subject: multiple db connection --username and password


> Hi,
>
> I am making connection to two databases in my repository.xml as
follows.
>
>
>     <!-- this connection was used as the default one within OJB -->
>     <jdbc-connection-descriptor
>    jcd-alias="conn1"
>    default-connection="true"
>    platform="MsSQLServer"
>    jdbc-level="2.0"
>    driver="com.inet.tds.TdsDriver"
>    protocol="jdbc"
>    subprotocol="inetdae7a"
>
>
dbalias="10.4.5.96:1433?database=db1&amp;sql7=true&amp;useCursorsAlways=
fals
> e"
>    username="sa"
>    password=" "
>    batch-mode="false"
>      >
>
>        <jdbc-connection-descriptor
>    jcd-alias="conn2"
>    default-connection="false"
>    platform="MsSQLServer"
>    jdbc-level="2.0"
>    driver="com.inet.tds.TdsDriver"
>    protocol="jdbc"
>    subprotocol="inetdae7a"
>
>
dbalias="10.4.5.36:1433?database=db2&amp;sql7=true&amp;useCursorsAlways=
fals
> e"
>    username="sa"
>    password=""
>    batch-mode="false"
>      >
>
>
> One of the connection is default , other is not. Default one works
fine..
> but for the second one
> I must have to create a pbkey with user name and password although as
> follows:
>
>  PBKey pbkey= new PBKey("conn2","sa","");
>
> The other constructor
>
> PBKey pbkey= new PBKey("conn2",null,null );
>
> Does not work and complains the connection can not be established for
user
> null
>
> My question is how I can use the username and password defined in
> repository.xml and not explicitly call whenever I am initializing
PBKey.
>
>
> Thanks
>
> Ismail
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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