数据库连接池报错com.alibaba.druid.pool.DruidDataSource error

com.alibaba.druid.pool.DruidDataSource error

我的源码如下:

package com.hnxy.utils;

import com.alibaba.druid.pool.DruidDataSource;
//数据库连接的工具类 提供连接池的数据源对象的获取
public class JDBCUtil {
	
	private static DruidDataSource ds = new DruidDataSource();
	
	//定义四大属性
	private static final String CONN_DRIVER = "com.mysql.jdbc.Driver";
	private static final String CONN_URL = "jdbc:mysql:///jdbc_db?characterEncoding = UTF-8";
	private static final String CONN_USER = "root";
	private static final String CONN_PASS = "root";
	
	//静态块
	static{
		ds.setDriverClassName(CONN_DRIVER);
		ds.setUrl(CONN_URL);
		ds.setUsername(CONN_USER);
		ds.setPassword(CONN_PASS);
	}

	public static DruidDataSource getDs() {
		return ds;
	}
	
	
}

然后我的是密码写错了
private static final String CONN_PASS = “root”;
所有出错了

参考文章:
https://bbs.csdn.net/topics/392371112

https://blog.csdn.net/IT_laobai/article/details/80684129

你可能感兴趣的:(MySql)