> Here is my code try to compile but prompt me this error
> unreported exception java.sql.SQLException; must be caught or
> declared to
> be thrown
> String uName = validateUser(userId, password);
<snip>
> public String validateUser(String inputUserid, String inputPwd)
> throws SQLException {
Hi,
Your validateUser() method does not need to declare SQLException
as thrown; the try { ... } catch block inside the method deals
with any Exception that may occur, and doesn't seem to re-throw
SQLException. Of course, you could also change the handling so
validateUser() does indeed throw SQLException, and deal with it
by putting try { ... } catch around the call to that method.
Cheers,
Dave.
--
David Long <davidl@w...>
Wrox Press - Programmer to Programmer(tm)
http://p2p.wrox.com/