Estoy tratando de hacer la conexión de mi proyecto a la base de datos.
public class Conexion {
private String USUARIO = "";
private String CONTRASENA = "";
private String HOST = "localhost:8080";
private String PORT = "3306";
private String DATABASE = "ingreso";
private String CLASSNAME = "com.mysql.jdbc.Driver";
private String URL = "jdbc:mysql://" + HOST + ": " + PORT + "/" + DATABASE;
private Connection con;
public Conexion() {
try {
Class.forName(CLASSNAME);
con = DriverManager.getConnection(URL, USUARIO, CONTRASENA);
} catch (ClassNotFoundException e) {
System.out.println("ERROR " + e);
} catch (SQLException e) {
System.out.println("ERROR " + e);
}
}
public Connection getConexion() {
return con;
}
public static void main(String[] args) {
Conexion con = new Conexion();
}}
Pero me arroja este error a la hora de compilar:
ERROR com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "8080: 3306"'.
BUILD SUCCESSFUL (total time: 0 seconds)