mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-04-17 14:10:02 +02:00
corrected db initialization sequence
Former-commit-id: bfea90ba44673f49b76d509688a6e4a4d6a912a0
This commit is contained in:
@@ -85,7 +85,8 @@ public final class ConnectionFactory {
|
||||
if (connectionString != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Connection conn = null;
|
||||
try {
|
||||
//load the driver if necessary
|
||||
final String driverName = Settings.getString(Settings.KEYS.DB_DRIVER_NAME, "");
|
||||
if (!driverName.isEmpty()) { //likely need to load the correct driver
|
||||
@@ -127,7 +128,6 @@ public final class ConnectionFactory {
|
||||
Logger.getLogger(CveDB.class.getName()).log(Level.FINE, "Connection String: {0}", connectionString);
|
||||
Logger.getLogger(CveDB.class.getName()).log(Level.FINE, "Database User: {0}", userName);
|
||||
|
||||
Connection conn = null;
|
||||
try {
|
||||
conn = DriverManager.getConnection(connectionString, userName, password);
|
||||
} catch (SQLException ex) {
|
||||
@@ -146,6 +146,7 @@ public final class ConnectionFactory {
|
||||
Logger.getLogger(ConnectionFactory.class.getName()).log(Level.FINE, "Unable to connect to the database", ex);
|
||||
throw new DatabaseException("Unable to connect to the database");
|
||||
}
|
||||
}
|
||||
|
||||
if (shouldCreateSchema) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user