try {
// Your code goes here
} catch(java.net.ConnectException e) {
e.printStackTrace();
} catch(java.sql.SQLException e) {
e.printStackTrace();
}
Read up on exception handling before you go forward, dude.
try
{
// Your code goes here
}
catch(java.net.ConnectException e)
{
System.out.print(e);
}
catch(another e)
{
System.out.print(e);
}
catch(yetAnother e)
{
System.out.print(e);
}
catch(stillAnother e)
{
System.out.print(e);
}
// And in general
catch(Exception e)
{
System.out.print(e);
}