goomez
public text v1 · immutable public void conecta() {
conn=null;
try {
Class.forName("com.mysql.jdbc.Driver");
} catch(Exception ex) {
System.out.println("Error en class.forname");
}
try {
conn = DriverManager.getConnection(url,login,pass);
if (conn != null){
System.out.println("Conexión a base de datos "+url+" ... Ok");
}
} catch (SQLException ex) {
ex.printStackTrace();
System.out.println("Error en Driver.manager.getConnection");
}
}