I can see 2 possible causes why DriverManager.getConnection
returns null
.
The JDBC URL is invalid. Please check if your MySQL server runs on your machine on the default port (3306). If not, please include the port explicitly in the URL. Then,
coolingSystem
should be the name of an existing database on your server (not a table or something else). Last, please double check your credentials.The driver is not included in the runtime classpath. Does
Class.forName
throw any exception/error? Please check the logs for this purpose.