For oracle11g , setting "openjpa.ConnectionUserName" and "openjpa.ConnectionPassword" in java code error.

4 messages Options
Embed this post
Permalink
wang yu-3

For oracle11g , setting "openjpa.ConnectionUserName" and "openjpa.ConnectionPassword" in java code error.

Reply Threaded More More options
Print post
Permalink
Hi,
I guess it's a bug of OpenJPA 1.2.1.
I used ojdbc6.jar to connect oracle11g.

If I pass username and password in persistence.xml, everything will be OK.
But if I pass them from java code like below, the connecting will fail:
                map.put("openjpa.ConnectionUserName","tsam");
                map.put("openjpa.ConnectionPassword","tsam");

And I analyzed the stack trace, the stack is completely identical with
the case that I doesn't specify username and password for openjpa at
all.
And the stack is little different with using wrong username and password.

Is it an OpenJPA and Oracle integration bug?

Regards,
Yu Wang
wang yu-3

Re: For oracle11g , setting "openjpa.ConnectionUserName" and "openjpa.ConnectionPassword" in java code error.

Reply Threaded More More options
Print post
Permalink
Hi,
Anybody else has tried this?

Regards,
Yu Wang

On Thu, Jun 11, 2009 at 4:54 PM, wang yu<[hidden email]> wrote:

> Hi,
> I guess it's a bug of OpenJPA 1.2.1.
> I used ojdbc6.jar to connect oracle11g.
>
> If I pass username and password in persistence.xml, everything will be OK.
> But if I pass them from java code like below, the connecting will fail:
>                map.put("openjpa.ConnectionUserName","tsam");
>                map.put("openjpa.ConnectionPassword","tsam");
>
> And I analyzed the stack trace, the stack is completely identical with
> the case that I doesn't specify username and password for openjpa at
> all.
> And the stack is little different with using wrong username and password.
>
> Is it an OpenJPA and Oracle integration bug?
>
> Regards,
> Yu Wang
>
Michael Dick

Re: For oracle11g , setting "openjpa.ConnectionUserName" and "openjpa.ConnectionPassword" in java code error.

Reply Threaded More More options
Print post
Permalink
Hi Yu,

Are you setting the properties when you create the EM, or EMFactory? I
haven't had a chance to try it but (from memory) it should work on the
EMFactory but not with the EM.

-mike

On Wed, Jun 17, 2009 at 4:21 AM, wang yu <[hidden email]> wrote:

> Hi,
> Anybody else has tried this?
>
> Regards,
> Yu Wang
>
> On Thu, Jun 11, 2009 at 4:54 PM, wang yu<[hidden email]> wrote:
> > Hi,
> > I guess it's a bug of OpenJPA 1.2.1.
> > I used ojdbc6.jar to connect oracle11g.
> >
> > If I pass username and password in persistence.xml, everything will be
> OK.
> > But if I pass them from java code like below, the connecting will fail:
> >                map.put("openjpa.ConnectionUserName","tsam");
> >                map.put("openjpa.ConnectionPassword","tsam");
> >
> > And I analyzed the stack trace, the stack is completely identical with
> > the case that I doesn't specify username and password for openjpa at
> > all.
> > And the stack is little different with using wrong username and password.
> >
> > Is it an OpenJPA and Oracle integration bug?
> >
> > Regards,
> > Yu Wang
> >
>
wang yu-3

Re: For oracle11g , setting "openjpa.ConnectionUserName" and "openjpa.ConnectionPassword" in java code error.

Reply Threaded More More options
Print post
Permalink
Mike,
You're right. It works for EMFactory, not for EM.
Thanks.

Cheers,
Yu Wang

On Wed, Jun 17, 2009 at 11:29 PM, Michael Dick<[hidden email]> wrote:

> Hi Yu,
>
> Are you setting the properties when you create the EM, or EMFactory? I
> haven't had a chance to try it but (from memory) it should work on the
> EMFactory but not with the EM.
>
> -mike
>
> On Wed, Jun 17, 2009 at 4:21 AM, wang yu <[hidden email]> wrote:
>
>> Hi,
>> Anybody else has tried this?
>>
>> Regards,
>> Yu Wang
>>
>> On Thu, Jun 11, 2009 at 4:54 PM, wang yu<[hidden email]> wrote:
>> > Hi,
>> > I guess it's a bug of OpenJPA 1.2.1.
>> > I used ojdbc6.jar to connect oracle11g.
>> >
>> > If I pass username and password in persistence.xml, everything will be
>> OK.
>> > But if I pass them from java code like below, the connecting will fail:
>> >                map.put("openjpa.ConnectionUserName","tsam");
>> >                map.put("openjpa.ConnectionPassword","tsam");
>> >
>> > And I analyzed the stack trace, the stack is completely identical with
>> > the case that I doesn't specify username and password for openjpa at
>> > all.
>> > And the stack is little different with using wrong username and password.
>> >
>> > Is it an OpenJPA and Oracle integration bug?
>> >
>> > Regards,
>> > Yu Wang
>> >
>>
>