JDBC provides a database-neutral set of classes and interfaces that can be used by your Java class. The database-specific code is included in a driver library that is developed by the database vendor or third parties. The primary advantage of using a driver library is that your code can use the same JDBC API to talk to many different databases simply by changing the library used by your code. Also, by using a driver library, your code is simpler to develop, debug, and maintain, since the lower-level networking details are handled by the driver.
The JDBC specification identifies four types of drivers that can be used to communicate with data bases.