Do Jdbc driver program like ojdbc6_g.jar contains main() method?

299 Views Asked by At

Is Jdbc driver programs like ojdbc6_g.jar is an standalone application or it is only a library file which doesn't have main() method in the main class?

2

There are 2 best solutions below

1
Ghanshyam On

Jdbc driver programs like ojdbc6_g.jar are a library which don't have main function.

0
Mark Rotteveel On

A JDBC driver is a library for use by Java applications. As such, it doesn't need a main class. However, that doesn't mean that JDBC drivers never have a main class.

For example:

  • the PostgreSQL JDBC driver has a main class which prints a driver version, a notice that it isn't an executable program, and a basic usage instruction.
  • the Oracle JDBC driver declares oracle.jdbc.OracleDriver as its main class, and that prints some version information and diagnostic information.

However the fact these drivers have a main class is no indication that a JDBC driver must have a main class: its primary usage is as a library.