Not long time ago, I was doing some Java SE programming. To make use of JDBC, I would simply put driver in project's build path. And that is how everything worked.
But then I started studying about Servlets & JSPs. Instead of Java project, now I had Dynamic Web Project. I did the same work (put driver inside project's build path) and hoped everything would work. Unfortunately, it didn't.
I found out here that I need to register my driver using Class.forName() method.
My questions looks rather simple => Why I need to register driver for Dynamic Web Project, but not for Java Project?
Class.forName() was a mechanism to force loading of database drivers. It has been obsolete for a very long time now, but people keep replicating it.
A webapp should NOT be using a DriverManager It should be using a Database Connection Pool. Connection Pools define the database context (including the driver) to the webapp server, and that knowledge is not required by the webapp itself.
Science is the process of replacing what we "know" with what is TRUE. Politics, alas, often prefers to be the opposite.
It will give me the powers of the gods. Not bad for a tiny ad: