mysql驱动
1 private static final String URL = "jdbc:mysql://localhost:3306/test?serverTimezone=GMT"; 2 //?serverTimezone=GMT 3 //serverTimezone=GMT 4 private static final String USER = "root"; 5 private static final String PASSWORD = "root"; 6 7 private static Connection conn = null; 8 9 static { 10 try { 11 Class.forName("com.mysql.cj.jdbc.Driver"); 12 13 try { 14 conn = DriverManager.getConnection(URL, USER, PASSWORD); 15 } catch (SQLException e) { 16 e.printStackTrace(); 17 } 18 } catch (ClassNotFoundException e) { 19 e.printStackTrace(); 20 } 21 }
原文:https://www.cnblogs.com/103580458-zzw/p/11474995.html