javajdbcdriversjdbc-odbcojdbc

Why drivers are required for JDBC-ODBC?


I am having a little confusion of what I have studied. I have studied that drivers are software programs that are required to interact external hardware devices like printers,mouse,mobiles etc. But when I connect ODBC or JDBC in Java,it requires that we specify the drivers.

So why do we need to specify those drivers since our database( Oracle DBC ) is software and not a hardware.


Solution

  • Your understanding of a driver is not correct. Driver are not only for hardware that is external but driver are also needed for special cases of software interaction. In this case the driver is used to access another filesystem that your system alone wouldn't be able to understand. So the driver is used to connect to the database and to be able to interact with it.

    the exact definition is: Java Database Connectivity (JDBC) is an application programming interface (API) for the programming language Java, which defines how a client may access a database. (taken from wikipedia)