Header Ads

  • Breaking Now

    How will you differentiate the following two ways of loading a database driver?

    (1)DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    (2)Class.forName("oracle.jdbc.driver.OracleDriver");

    In case one, to load the driver, one needs an appropriate class to load, make a driver instance and register it with the JDBC driver manager. Class.forName() will cause the class to create an instance, and call the current class loader's DriverManager.registerDriver() method to announce its presence.While DriverManager.registerDriver registers an instance of the with driver manager.

    No comments

    Post Top Ad

    Post Bottom Ad