Skip to content

Commit 13ff294

Browse files
committed
Always iterate through drivers list to load them correctly.
1 parent f9bb8b7 commit 13ff294

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

javasource/databaseconnector/impl/JdbcConnectionManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public Connection getConnection(final String jdbcUrl, final String userName, fin
6868
private synchronized void initializeDrivers() {
6969
if (!hasDriversInitialized) {
7070
ServiceLoader<Driver> loader = ServiceLoader.load(Driver.class);
71+
Stream<String> driverNames = StreamSupport.stream(loader.spliterator(), false)
72+
.map(a -> a.getClass().getName());
73+
String logMessage = driverNames.collect(Collectors.joining(", ", "Found JDBC Drivers: ", ""));
7174
if (logNode.isTraceEnabled()) {
72-
Stream<String> driverNames = StreamSupport.stream(loader.spliterator(), false)
73-
.map(a -> a.getClass().getName());
74-
String logMessage = driverNames.collect(Collectors.joining(", ", "Found JDBC Drivers: ", ""));
7575
logNode.trace(logMessage);
7676
}
7777
hasDriversInitialized = true;

0 commit comments

Comments
 (0)