8211295: DriverManager.getConnection fails when called from com.sun.rowset.JdbcRowSetImpl

Reviewed-by: mchung, alanb
This commit is contained in:
Lance Andersen 2018-10-01 13:05:51 -04:00
parent 4374820705
commit c925556ec4
3 changed files with 85 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -652,7 +652,7 @@ public class DriverManager {
* can be loaded from here.
*/
ClassLoader callerCL = caller != null ? caller.getClassLoader() : null;
if (callerCL == null) {
if (callerCL == null || callerCL == ClassLoader.getPlatformClassLoader()) {
callerCL = Thread.currentThread().getContextClassLoader();
}