I created a class called BD in which i try to establish a connection with a database called bono
public class BD {
String url,login,password,driver;
Connection conexion=null;
public BD(){
driver = "com.mysql.jdbc.Driver";
url = new String("jdbc:mysql://localhost:8000/bono");
login = new String("root");
password = new String("mypassword");
try {
Class.forName(driver);
conexion = DriverManager.getConnection(url, login, password);
System.out.println("Conexi�n con Base de datos Ok....");
} catch (ClassNotFoundException e) { //
System.out.println("error 1");
} catch (SQLException e) {
System.out.println("error 2");
}
}
but when i execute it, it just stays in this following line:
conexion = DriverManager.getConnection(url, login, password);
it doesn't send any errors nor does it establish the connection. What should i do?