aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 580



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: 19541
    
  16

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: 580
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: 19541
    
  16

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

Joined: Aug 02, 2012
Posts: 580
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
 
Don't get me started about those stupid light bulbs.
 
subject: How to setup username, password and property at the same time?
 
Similar Threads
userguide.html question
Problems with non-english characters
NX: help.html in runme.jar
Changing FilePath from full filepath to project folder filepath
Problem with creating a file in the current directory and with the current time stamp