ruanwenjun commented on issue #17464: URL: https://github.com/apache/dolphinscheduler/issues/17464#issuecomment-3254397753
> > Using lock can avoid this? > > I don't think this is a good idea or that it's necessary. Based on the information I've reviewed, it's generally accepted that manually calling Class.forName to load the driver class is no longer required in Java 6 and later versions. Of course, I can't guarantee this applies to all data source types without issues. If you consider this to be a risk, I've also looked into Storm's approach for your reference. https://issues.apache.org/jira/browse/STORM-2527 OK, I got you, you are right, we don't need to call `Class.forName` here, it just registers the driver into DriverManager. This seems bug in driver, we should remove Class.forName here. In additional, we might better initialize the driver and use the driver to getConnection, i am not sure if the DriverManager can find the suitable Driver, since multiple driver might be matched. -- 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]
