这是什么原因,怎么解决啊?

问题遇到的现象和发生背景

银行管理系统,可以出GUI界面,但是写不进数据

问题相关代码,请勿粘贴截图
        //1.注册驱动  
 String driverClassName = "com.mysql.jdbc.Driver";  
 Class.forName("com.mysql.jdbc.Driver");  
         //2.连接数据库   
 Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3308/ren?useUnicode=true&characterEncoding=UTF-8","root","1234"); 
运行结果及报错内容

Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

我的解答思路和尝试过的方法
我想要达到的结果

你的MySQL是8.+版本的,需要用com.mysql.cj.jdbc.Driver这个驱动,但是用5.+版本的驱动也没问题,不算错误,一个告警信息吧

提示你驱动类过时了,用com.mysql.cj.jdbc.Driver代替com.mysql.jdbc.Driver。