Hello!
After some time trying to make new project, but stuck in very beginning.
The problem is that import does not see java library: The package java.sql is not accessible
mysql-connector-java-8.0.18.jar is added through Build path configuration.
Is there problem with mysql-connector-java-8.0.18.jar importing?
Here is code:
package newPackage; import java.sql.*; public class Piegades { public static void main(String[] args) throws Exception{ String url = "jdbc:mysql://localhost:3306/testdb"; String user = "root"; String password = "password"; Class.forName("com.mysql.cj.jdbc.Driver"); Connection con = DriverManager.getConnection(url, user, password); System.out.println("Connection made"); con.close(); System.out.println("Connection closed!"); } }