Connection connection = DriverManager.getConnection(url,user,password);
数据库连接出现问题,
Connection connection = null;
try {
Class.forName(driver);
//Log.i(TAG, "mGetConnect: driver success");
//获取连接
connection = DriverManager.getConnection(url,user,password);
}catch (Exception e){
e.printStackTrace();
}
//注释和上面的异常可以替换
// catch (ClassNotFoundException e){
// e.printStackTrace();
// } catch (SQLException e){
// e.printStackTrace();
// }
return connection;
问题解决