This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Let's suppose an exception is thrown before a value is assigned to the "connection" variable. You catch that exception and print a message. Then you carry on and try to use the "connection" variable, which is still null.
As you imply, the real problem is something else, namely something to do with loading the driver class. Your code printed the exception, which you didn't share with us. So read it and act accordingly.
Joined: Mar 04, 2008
Thanks Paul. This is the exception I ma getting. It doesn't seem that problem with loading driver. I get the value of the drive printed in the output.
java.lang.NullPointerException at tests.functional.cartridge.spatial.common.apps.spatial_cartridge.SpatialDBHelper.getJDBCConnection(SpatialDBHelper.java:53)