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 whats wrong here in connection string 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 "whats wrong here in connection string" Watch "whats wrong here in connection string" New topic
Author

whats wrong here in connection string

divya kundapur
Ranch Hand

Joined: Aug 21, 2007
Posts: 110
Hi,

I'm getting this error --- java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)



Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+ prop.getProperty("DATABASE_SERVER_NAME")+","+prop.getProperty("DATABASE_SERVER_USERNAME") +","+ prop.getProperty("DATABASE_SERVER_PASSWORD")+"");

when i use system.out it prints out this

-- jdbc:mysql://localhost:3306/auto_mail,root,root123


SCJP - 5.0
divya kundapur
Ranch Hand

Joined: Aug 21, 2007
Posts: 110
I solved it , changed a little bit



Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+ prop.getProperty("DATABASE_SERVER_NAME")+"?user="+prop.getProperty("DATABASE_SERVER_USERNAME") +"&password="+ prop.getProperty("DATABASE_SERVER_PASSWORD")+"");

 
Have you checked out Aspose?
 
subject: whats wrong here in connection string
 
It's not a secret anymore!