问题:
Unable to get connection, DataSource invalid: "java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support."

解决:

主要是驱动包版本的问题
8.0以上的MySQL要用相符合的jar包,同时在连接数据库的写法上也要修改个别地方
jsp 连接MySQL数据库错误二

例如:

Class.forName(“com.mysql.cj.jdbc.Driver”);
conn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/databaseName?useSSL=false&serverTimezone=UTC”,“root”,“password”);
(上面的黑体是关键,一定要加在你的路径后面,是8.0以上的写法)

至于基本用 jstl 标签库并使用 jsp连接数据库,可参考:
https://www.runoob.com/jsp/jsp-jstl.html

https://www.runoob.com/jsp/jsp-database-access.html

相关文章: