Following code:
Class.forName(dbDriver); // "org.postgres.Driver" or "com.mysql.jdbc.Driver"
is / was necessary to open JDBC connection.
I have heard that it is no longer needed with modern JDBC drivers. However I can't remove it in my project, because I'm getting No suitable driver found
exception. I am using postgresql-9.1-901.jdbc3.jar
, Java7 and tomcat7.
When can I omit Class.forName(...)
construct?