public enum ClassLoaderStrategy extends java.lang.Enum<ClassLoaderStrategy>
thread context classloader.
The class is NOT public API, so it is subject to change.
| Enum Constant and Description |
|---|
CONTEXT_FIRST
Try the thread context classloader first, then fall back to the driver's classloader.
|
DRIVER
Use the driver's classloader only.
|
DRIVER_FIRST
Try the driver's classloader first, then fall back to the thread context classloader.
|
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
value |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.ClassLoader> |
classLoaders(java.lang.ClassLoader driverClassLoader,
java.lang.ClassLoader contextClassLoader)
Returns the non-null classloaders to try, in priority order.
|
static ClassLoaderStrategy |
of(java.util.Properties info)
Resolves the strategy from the
PGProperty.CLASS_LOADER_STRATEGY connection property. |
static ClassLoaderStrategy |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ClassLoaderStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClassLoaderStrategy DRIVER
public static final ClassLoaderStrategy DRIVER_FIRST
public static final ClassLoaderStrategy CONTEXT_FIRST
public static ClassLoaderStrategy[] values()
for (ClassLoaderStrategy c : ClassLoaderStrategy.values()) System.out.println(c);
public static ClassLoaderStrategy valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static ClassLoaderStrategy of(java.util.Properties info) throws PSQLException
PGProperty.CLASS_LOADER_STRATEGY connection property.info - connection propertiesDRIVER_FIRST when the property is absentPSQLException - if the property holds an unknown valuepublic java.util.List<java.lang.ClassLoader> classLoaders(java.lang.ClassLoader driverClassLoader,
java.lang.ClassLoader contextClassLoader)
driverClassLoader - the driver's own classloadercontextClassLoader - the thread context classloaderCopyright © 2026 PostgreSQL Global Development Group. All rights reserved.