What is the actual use of Class.forName(\"oracle.jdbc.driver.OracleDriver\") while connecting to a database? Why cant we just import the same class, instead why
Class.forName(\"oracle.jdbc.driver.OracleDriver\")
This is used for to open a class or in other words invoke it via its name from string format. For example:
Class.forName("com.android.example.MainClass");
And it will start the class inside the package com/android/example/MainClass.java