package tutorialJava.capitulo9_AWT_SWING.v05_JListConDefaultListModel.controller;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectionManager {

	private static Connection conn = null;
	
	
	public static Connection getConnection() throws Exception {
		if (conn == null) {
			Class.forName("com.mysql.cj.jdbc.Driver");
		   
			conn = 
					(Connection) DriverManager.getConnection (
					"jdbc:mysql://localhost:3306/poblacionprovincia?serverTimezone=UTC",
					"root", "1234");
		}
		return conn;
	}
}
