Re: Connection / Permission Problems with java applet
I have the same problem... My applet works fine in my local web server, but when I upload to my web hosting the message appear:
Error: java.sql.SQLException: Access denied for user 'labinfor'@'localhost' (using password: YES)
java.sql.SQLException: Access denied for user 'labinfor'@'localhost' (using password: YES)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:750)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3558)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1151)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:1768)
at com.mysql.jdbc.Connection.<init>(Connection.java:430)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at QueryDBApplet.ConectaBD(QueryDBApplet.java:352)
at QueryDBApplet.Conecta(QueryDBApplet.java:366)
at QueryDBApplet.Logon(QueryDBApplet.java:798)
at QueryDBApplet.actionPerformed(QueryDBApplet.java:237)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
***********************************************
I just don´t understand how I can access the same data base with PHP and the getConnection method doesn´t work when it´s running in the web hosting. My code:
public void ConectaBD()
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
}
catch(Exception e)
{
System.out.println("Error: " + e);
}
try
{
con = DriverManager.getConnection("jdbc:mysql://localhost/labinfor_com_br?user=labinfor&password=123456");
System.out.println("Connection success!!!");
}
catch(SQLException e)
{
System.out.println("Error: " + e );
e.printStackTrace();
}
}
The only difference is that in my local web server the MySQL server is version 4.1 and the web hosting uses MySQL Server 3.23.x or something like that.....
Can anybody help me?
Thank you.....
Subject
Written By
Posted
November 19, 2004 05:48AM
February 15, 2005 04:04AM
November 24, 2004 10:23PM
February 15, 2005 12:28PM
February 15, 2005 12:29PM
December 12, 2004 07:17PM
December 14, 2004 05:28AM
December 18, 2004 04:07PM
Re: Connection / Permission Problems with java applet
November 03, 2005 07:12AM
November 06, 2007 08:40AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.