private static Connection conexion() {
try {
//Cargamos el Driver MySQL
conexion = DriverManager.getConnection(server, user, pass);
} catch (Exception e) {
JOptionPane.showMessageDialog(null,"Error "+e);
System.out.println("SQLException: " + e.getMessage());
System.out.println("SQLState: " + ((SQLException) e).getSQLState());
System.out.println("VendorError: " + ((SQLException) e).getErrorCode());
}
return conexion;
}
private static Connection conexion() {
try