Aggarwal-Raghav commented on code in PR #6207:
URL: https://github.com/apache/hive/pull/6207#discussion_r2564240231


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/jdbc/NoPoolConnectionPool.java:
##########
@@ -62,38 +60,23 @@ public Connection getConnection() throws SQLException {
 
   @Override
   public Connection getConnection(String username, String password) throws 
SQLException {
-    // Find the JDBC driver
-    if (driver == null) {
-      String driverName = MetastoreConf.getVar(conf, 
MetastoreConf.ConfVars.CONNECTION_DRIVER);
-      if (driverName == null || driverName.equals("")) {
-        String msg = "JDBC driver for transaction db not set in configuration 
" +
-            "file, need to set " + 
MetastoreConf.ConfVars.CONNECTION_DRIVER.getVarname();
-        LOG.error(msg);
-        throw new RuntimeException(msg);
-      }
-      try {
-        LOG.info("Going to load JDBC driver {}", driverName);
-        driver = (Driver) Class.forName(driverName).newInstance();
-      } catch (InstantiationException e) {
-        throw new RuntimeException("Unable to instantiate driver " + 
driverName + ", " +
-            e.getMessage(), e);
-      } catch (IllegalAccessException e) {
-        throw new RuntimeException(
-            "Unable to access driver " + driverName + ", " + e.getMessage(),
-            e);
-      } catch (ClassNotFoundException e) {
-        throw new RuntimeException("Unable to find driver " + driverName + ", 
" + e.getMessage(),
-            e);
-      }
-      connString = MetastoreConf.getVar(conf, 
MetastoreConf.ConfVars.CONNECT_URL_KEY);
+    String driverName = MetastoreConf.getVar(conf, 
MetastoreConf.ConfVars.CONNECTION_DRIVER);

Review Comment:
   Sure. will remove driverName from here.



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