File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
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")+"");

 
jQuery in Action, 3rd edition
 
subject: whats wrong here in connection string
 
jQuery in Action, 3rd edition