This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 and Relational Databases
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: 634



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: 20078
    
  30

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


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

Joined: Aug 02, 2012
Posts: 634
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: 20078
    
  30

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

Joined: Aug 02, 2012
Posts: 634
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to setup username, password and property at the same time?
 
It's not a secret anymore!