Correct Me if i am wrong
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Neeraj Dhiman wrote:Please use code tag for java code. it will easier to read.
May be Something wrong with yours java.sql.* package;
you are using import as java.sql.Connection.*;
use java.sql.Connection; same for Resultset and Statement
Please post you code in CODE TAG.
Correct Me if i am wrong
Neeraj Dhiman wrote:you should catch the naming exception.
try this
hope this will work.
now following exception is coming
DBPhoneLookup.java:40: unreported exception java.lang.Exception; must be caught or declared to be thrown
if (envContext == null)throw new Exception("Error: No Context");
^
DBPhoneLookup.java:41: unreported exception java.lang.Exception; must be caught or declared to be thrown
if (ds == null) throw new Exception("Error: No DataSource");
Correct Me if i am wrong
Consider Paul's rocket mass heater. |