Actually not so good JAJA, I have a problem with the connection from java to mysql and import the library the jar even though I made the connection and it tells me that the connection is not established.
I show you the connection code
package modelo.dao;
import java.sql.*;
public class conexion {
static String bd = "merca_ruta";
static String login = "root";
static String password ="";
static String url = "jdbc:mysql://localhost:/" + bd;
Connection conn = null;
public conexion (){
try {
// cargar nuestro driver
Class.forName("com.mysql.jdbc.Driver");
conn=DriverManager.getConnection("url, login, password");
if (conn != null) {
System.out.println("Conenecting database [" + conn + "] OK");
}
} catch (SQLException e)
{
System.out.println("Exepcion conexion: " + e.getMessage());
} catch (ClassNotFoundException e)
{
System.out.println("Excepcion driver: " + e.getMessage());
}
}
public Connection getConnection() {
return conn;
}
public void disconnet(){
System.out.println("closing database: ["+ conn + "] OK");
if (conn !=null) {
try {
conn.close();
} catch (SQLException e) {
System.out.println(e);
}
}
}
}
I hope you can help me thank you thank you.