• 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

db connection problem

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all.
In a jsp application, I�m trying to conect to the application�s db (MySQL) by:
// jsp file
<%
YYY.Atividade atv;
atv = new YYY.Atividade();
atv.criaConexaoBD();
%>
// bean
public void criaConexaoBD()throws ClassNotFoundException, IllegalAccessException,InstantiationException, SQLException
{
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://130.1.1.130/mdb1";
Class.forName(driver).newInstance();
this.conexaoBanco = DriverManager.getConnection(url, "root", "");
this.v_statement = this.conexaoBanco.createStatement();
}

I�m getting this server (Tomcat v. 5.0) message:

ERRO :java.sql.SQLException: Invalid authorization specification, message from server: "Access denied for user: 'root'@'egdesenvolv.globoprdom.com.br' (Using password: NO)" .

Even using a password or changing the user i�m getting the same trouble...I know that if i use
url= "jdbc:mysql://localhost/mdb1";
the connection work�s...

Does somebody know�s what�s wrong?
Thank�s for your attention,
Rafael.
[ October 11, 2004: Message edited by: Rafael Castro Fagundes ]
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think it is something about MYSQL Driver. see the specification of MYSQL Driver. may be it differs when your DB is remote.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since this is much more about JDBC than the JSP enclosing it, I'm moving this along to the JDBC forum.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic