class ojdbc6.jar 的主要清单信息

Main class manifest information for ojdbc6.jar

我查看了ojdbc6.jar下的META-INF/MANIFEST.MF文件,结果如下

Manifest-Version: 1.0
Implementation-Vendor: Oracle Corporation
Implementation-Title: ojdbc6.jar
Implementation-Version: Oracle JDBC Driver version - "11.1.0.7.0-Produ
 ction"
Implementation-Time: Wed Sep 10 15:03:50 2008
Specification-Vendor: Oracle Corporation
Sealed: true
Created-By: 1.6.0 (Sun Microsystems Inc.)
Specification-Title: Oracle JDBC driver classes for use with JDK6
Specification-Version: Oracle JDBC Driver version - "11.1.0.7.0-Produc
 tion"
Main-Class: oracle.jdbc.OracleDriver

Name: oracle/sql/converter_xcharset/
Sealed: false

Name: oracle/sql/
Sealed: false

Name: oracle/sql/converter/
Sealed: false

在这些清单信息中,Main-Class: oracle.jdbc.OracleDriver 行引起了我的注意。我理解 Main-Class 属性的概念。但我不确定为什么这个 class 必须是 main class.

显然,这似乎是 oracle 给我们的一项规定,用于检查任何给定 ojdbc6.jar 文件的 Oracle 驱动程序的版本。

https://docs.oracle.com/cd/B28359_01/java.111/b31224/getsta.htm#i1008663

要查看驱动版本,您只需要运行 java -jar ojdbc6.jar.

C:\Users\raja\Downloads>java -jar ojdbc6.jar
Oracle 12.1.0.1.0 JDBC 4.0 compiled with JDK6 on Thu_Apr_04_15:06:58_PDT_2013
#Default Connection Properties Resource
#Thu Nov 05 15:51:12 GMT 2015