public static Connection getConnection() throws ClassNotFoundException, SQLException{ //注册驱动 Class.forName(pro.getProperty("driver")); //获取连接 Connection con = DriverManager.getConnection(pro.getProperty("url"),pro.getProperty("user") , pro.getProperty("password")); return con; }