It throws " exception java.sql.exception has already been caught.
No, it doesn't throw anything. It's a compile error.
If sqlexception caught in catch(Exception e) block then why catch(sqlexception)
SQLException extends Exception, so if you catch Exception first, you'll never be able to reach the SQLException catch block. However, if you place the SQLException catch block
before the Exception one, you'll be able to catch SQLException specifically, and catch all other Exceptions in the other catch block. You always have to write multiple catch blocks from most specific, to most general.