Bem gente não consigo fazer uma conexão com o mysql que está no linux e o meu tomcat está no Win200.
A minha classe de conexão é essa:
package comn;
import java.sql.Connection;
import java.sql.DriverManager;
/**
-
@author Administrador
-
To change this generated comment edit the template variable “typecomment”:
-
Window>Preferences>Java>Templates.
-
To enable and disable the creation of type comments go to
-
Window>Preferences>Java>Code Generation. */ public class Conexao { final private static String URL = “jdbc:mysql://servidor/banco”; private static String login = “”; private static String senha = “”; private static Connection con;
public static Connection obtemConexao() throws Exception{ try{ Class.forName(“com.mysql.jdbc.Driver”); con = DriverManager.getConnection(URL,login,senha); return con; } catch (Exception e){ // handle any errors System.out.println("SQLException: " + e.getMessage()); String s = e.getMessage(); return null; }
}
}
O Exception me retorna a seguinte mensagem:
“Data source rejected establishment of connection, message from server: “Host ‘10.0.0.1’ is not allowed to connect to this MySQL server””
Porfavor me ajudem…
