mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-09-28 17:44:38 +08:00
update exception
This commit is contained in:
@ -84,24 +84,16 @@ public class IDriverManager {
|
|||||||
driverEntry = getJDBCDriver(driver);
|
driverEntry = getJDBCDriver(driver);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Connection con = driverEntry.getDriver().connect(url, info);
|
return driverEntry.getDriver().connect(url, info);
|
||||||
if (con != null) {
|
|
||||||
return con;
|
|
||||||
}
|
|
||||||
} catch (SQLException var7) {
|
} catch (SQLException var7) {
|
||||||
Connection con = tryConnectionAgain(driverEntry, url, info);
|
Connection con = tryConnectionAgain(driverEntry, url, info);
|
||||||
if (con != null) {
|
if (con != null) {
|
||||||
return con;
|
return con;
|
||||||
} else {
|
} else {
|
||||||
throw var7;
|
throw new SQLException("Cannot create connection (" + var7.getMessage() + ")", "08001",
|
||||||
|
var7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reason != null) {
|
|
||||||
throw reason;
|
|
||||||
} else {
|
|
||||||
throw new SQLException("No suitable driver found for " + url, "08001");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Connection tryConnectionAgain(DriverEntry driverEntry, String url,
|
private static Connection tryConnectionAgain(DriverEntry driverEntry, String url,
|
||||||
|
Reference in New Issue
Block a user