Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
连接器/J 8.0.11 有一些更改,因为旧代码行无法用于连接。
最新连接的正确方法是:
Class.forName("com.mysql.cj.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/DBname?autoReconnect=true&useSSL=false", "username", "password"); Statement st = conn.createStatement();