This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes How to setup username, password and property at the same time? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to setup username, password and property at the same time?" Watch "How to setup username, password and property at the same time?" New topic
Author

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

Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 600



I need to set the user, password and locale at the same time, how do I do that?
Thanks
Jack
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

Most drivers support setting properties "user" and "password".


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 600
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

Joined: Oct 27, 2005
Posts: 19697
    
  20

Odd. You're code is the same as here.
Jacky Luk
Ranch Hand

Joined: Aug 02, 2012
Posts: 600
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
 
 
subject: How to setup username, password and property at the same time?