JDBC - Driver Version

Jdbc Class Architecture

About

How to get the Jdbc Driver version ?

getDriverVersion

You can determine the version of the JDBC driver that you installed by calling the getDriverVersion method of the OracleDatabaseMetaData class.

import java.sql.*;
import oracle.jdbc.*;
import oracle.jdbc.pool.OracleDataSource;

class JDBCVersion
{
  public static void main (String args[]) throws SQLException
  {
    OracleDataSource ods = new OracleDataSource();
    ods.setURL("jdbc:oracle:thin:hr/hr@localhost:1521/XE");
    Connection conn = ods.getConnection();

    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData();

    // gets driver info:
    System.out.println("JDBC driver version is " + meta.getDriverVersion());
  }
}

Oracle Jdbc

Starting from Oracle Database 11g Release 1, you can get details about the JDBC support in the database as follows:

java -jar ojdbc6.jar
Oracle 11.1.0.0. JDBC 4.0 compiled with JDK6

Note: The JDBC Thin Driver requires a TCP/IP listener to be running on the computer where the database is installed.

Documentation / Reference







Share this page:
Follow us:
Task Runner