pan3793 commented on code in PR #5433:
URL: https://github.com/apache/kyuubi/pull/5433#discussion_r1361691869


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/metadata/jdbc/JDBCMetadataStore.scala:
##########
@@ -46,10 +46,17 @@ class JDBCMetadataStore(conf: KyuubiConf) extends 
MetadataStore with Logging {
 
   private val dbType = 
DatabaseType.withName(conf.get(METADATA_STORE_JDBC_DATABASE_TYPE))
   private val driverClassOpt = conf.get(METADATA_STORE_JDBC_DRIVER)
+  private lazy val mysqlDriverClass =
+    try {
+      Class.forName("com.mysql.cj.jdbc.Driver", false, 
Thread.currentThread.getContextClassLoader)
+      "com.mysql.cj.jdbc.Driver"
+    } catch {
+      case _: ClassNotFoundException => "com.mysql.jdbc.Driver"
+    }

Review Comment:
   I just realized there is a method `ReflectUtils#isClassLoadable`, that can 
simplify the code.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to