In a simple jdbc example , when we load a driver through a java class, the practise is to use Class.forName("com.mysql.jdbc.Driver").newInstance();
Why we do not use new com.mysql.jdbc.Driver();?
In a simple jdbc example , when we load a driver through a java
Share
This piece of code isn’t really intended to create an instance of the driver but to ensure the driver class is loaded by the class loader. Nowadays this is no longer needed, see: