title: How to get JDBC Driver class name from connection object during runtime?
body: <p>I have created my JDBC connection like bellow:</p>
  
  <pre><code>java.sql.Connection conn =  java.sql.DriverManager.getConnection(
                      "jdbc:oracle:thin:@localhost:1521:DBSID", "DB_USER",
                      "DB_PASS");
  </code></pre>
  
  <p>How can I get JDBC driver class name (e.g. <strong>"oracle.jdbc.driver.OracleDriver"</strong>) during run-time something like that:</p>
  
  <pre><code>String driverClsName  = getDriverClsName(conn);
  //e.g.  driverClsName = "oracle.jdbc.driver.OracleDriver"
  </code></pre>
  
  <p>I've already searched stackoverflow for that but no final solution found. </p>
  
  <p>Already viewed  <a href="https://stackoverflow.com/questions/22317215/how-to-get-driver-class-name-not-driver-name-from-jdbc-connection">How to get driver class name (not driver name) from jdbc connection</a>
  <br>
  <br>What should be code inside below method:</p>
  
  <pre><code>String getDriverClsName(Connection conn){
      //code here
  }
  </code></pre>
  
  <p>I've already tried <code>conn.getMetaData().getDriverName();</code> which is returning <strong>Oracle JDBC driver</strong>.
  <br></p>
  
  <p>My requirement is to show information(such as class name) about current driver being used in the application.</p>