QLiGongZhongJieZhe
2017-03-04 02:49
采纳率: 100%
浏览 2.3k
已采纳

在eclipse出现下面问题

com.mysql.cj.core.exceptions.WrongArgumentException: Connector/J cannot handle a database URL of type 'jdbc
public static Connection getConn() {
Connection conn = null;
try {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
conn = DriverManager.getConnection("jdbc.mysql://localhost/bbs?serverTimezone=UTC&user=root&password=tiger");
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
return conn;
}

3条回答 默认 最新

相关推荐 更多相似问题