Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to setup username, password and property at the same time?

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



I need to set the user, password and locale at the same time, how do I do that?
Thanks
Jack
 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most drivers support setting properties "user" and "password".
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Most drivers support setting properties "user" and "password".


Dear Rob,
I actually tried


I was sure that the password was correct, but the preivous way connects but this way I can't.
The password is the same in both cases. That's really strange
Thanks
Jack
 
Rob Spoor
Sheriff
Pie
Posts: 20605
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Odd. You're code is the same as here.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Odd. You're code is the same as here.


Hi Rob,
I got the job done. The way I did it was that I passed the password as a char[] rather than a String so that the property object accepts it fine now.
Thanks
Jack
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic