• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

whats wrong here in connection string

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
divya kundapur
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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")+"");

 
"Don't believe every tiny ad you see on the internet. But this one is rock solid." - George Washington
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic