pranavbhandari24 commented on code in PR #25824:
URL: https://github.com/apache/beam/pull/25824#discussion_r1152408694


##########
sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java:
##########
@@ -575,12 +583,21 @@ public DataSourceConfiguration withMaxConnections(
     }
 
     /**
-     * Sets the class loader instance to be used to load the JDBC driver. If 
not specified, the
-     * default class loader is used.
+     * Sets the directory to the JDBC driver in the worker. If specified, the 
path is used to load
+     * the driver jar. If not specified, the default class loader is used to 
load the jars.
+     *
+     * <p>NOTE - driverJarDirectory must be the absolute path to the directory.
      */
-    public DataSourceConfiguration withDriverClassLoader(ClassLoader 
driverClassLoader) {
-      checkArgument(driverClassLoader != null, "driverClassLoader can not be 
null");
-      return builder().setDriverClassLoader(driverClassLoader).build();
+    public DataSourceConfiguration withDriverJarDirectory(String 
driverJarDirectory) {
+      checkArgument(driverJarDirectory != null, "driverJarDirectory can not be 
null");
+      return 
withDriverJarDirectory(ValueProvider.StaticValueProvider.of(driverJarDirectory));
+    }
+
+    /** Same as {@link #withDriverJarDirectory(String)} but accepting a 
ValueProvider. */
+    public DataSourceConfiguration withDriverJarDirectory(
+        ValueProvider<@Nullable String> driverJarDirectory) {

Review Comment:
   I added value providers since we want to migrate classic templates using 
DynamicJdbcIO to JdbcIO as well.
   ValueProviders are needed for classic templates



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to