Your driver probably wasn't loaded properly. 

DriverManager.getConnection() would have thrown a SQLException if it
couldn't connect on this line: 

dbCon = DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD);

That would have been caught by this: 

    catch(SQLException sqle) {
      out.println("<blockquote><UL><FONT COLOR=#00C000>Get Method - SQL
Exception error:</FONT></UL></blockquote>" + sqle);
    }

But in the finally block, you are trying to call the close() method on
Object dbCon, which never got instantiated in the first place (because
of the exception). 

Try changing this line: 

dbCon.close();

To: 

if (dbCon != null) dbCon.close();


Are you getting any other output at all besides the
NullPointerException? Usually Tomcat also shows the 'Root cause'
exception on the error page that can help you track it down. 

-August

--- "PELOQUIN,JEFFREY (Non-HP-Boise,ex1)" <[EMAIL PROTECTED]>
wrote:
> John,
> 
> you might try this to see if the database is accessible
> 
> telnet ipaddress 1521
> 
> if the port is accessible you should get something similar to
>  
> Trying...
> Connected to ipaddress 
> Escape character is '^]'.
> 
> if you cannot access the port you should either get a connection
> refused
> error
> or it will just do nothing
> 
> 
> Jeff
> 
> -----Original Message-----
> From: John Wadkin [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 31, 2002 10:41 AM
> To: Tomcat Users List (E-mail)
> Subject: NullPointerException: causes?
> 
> 
> Can anyone offer any suggestions about the cause of the attached
> NullPointerException trace?
> 
> I've managed to setup and integrate Apache 1.3 and Tomcat 4.1 using
> mod_WebApp on Solaris 8 (JDK 1.3). I ran the attached servlet (which
> I
> didn't write) with the hope of testing that everything was working
> ok,
> especially the Oracle/JDBC bit.
> 
> As far as I can tell, everything is configured properly...
> 
> The general aim is for me to verify that everything works (using the
> attached servlet) before trying to deploy a second, more complex
> servlet
> that's currently running under JServ.
> 
> Apologies if this is a frequent question but I've only been able to
> find
> vague references to it, and I'm only a novice Java programmer!
> 
> Thanks,
> 
> John
> 
> Quote for the week:
> 
> My fellow Americans, I am pleased to tell you I just signed
> legislation
> which outlaws Russia forever. The bombing begins in five minutes.
> 
> Ronald Reagan, Radio microphone test, 11 Aug. 1984
> 
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to