**最近在跟着B站up主遇见狂神说学习MySQL,到了JDBC部分,用Java链接数据库并进行增删改查操作,跟着打了一遍代码,但是出现大面积报错。代码如下:
配置文件db.propertiws与包装工具类JdbcUtils
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/jdbcstudy?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true
username=root
password=123456
public class JdbcUtils {
private static String driver = null;
private static String url = null;
private static String username = null;
private static String password = null;
static {
try {
InputStream in = JdbcUtils.class.getClassLoader().getResourceAsStream("db.properties");
Properties properties = new Properties();
properties.load(in);
driver = properties.getProperty("driver");
url = properties.getPro