⽤idea连接mysql时,出现.NullPointerException异常这是⼯具类:
private static String driver = null;
private static String url = null;
private static String username = null;
private static String password = null;
static{
mysql下载出现installertry{
InputStream in = ClassLoader().getResourceAsStream("db.properties");
Properties properties = new Properties();
properties.load(in);
driver = Property("name");
url = Property("url");
username = Property("username");
password = Property("password");
//1.驱动只⽤加载⼀次
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论