How to connect to jdbc with Connector/j 8.0.20
Posted by: ammar zorig
Date: May 12, 2020 01:39AM

Faild to connect to jdbc Jdk 8.0.u251
MySql Server 8.0
The connector/j 8.0.20
IDE : NetBeans 8.2

My code :
public Connection MySqlConnection() {
Connection conn = null;
try {
Class.forName("com.mysql.jdbc.Driver");
conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/aliens","root", "*************");
JOptionPane.showMessageDialog(null,"Mysql DB connection successful...");
return conn;
} catch (Exception e) {
JOptionPane.showMessageDialog(null,"Mysql connection failed....");
return null;
}
}

Options: ReplyQuote


Subject
Written By
Posted
How to connect to jdbc with Connector/j 8.0.20
May 12, 2020 01:39AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.