Can you provide the related code (including imports) you use here? Generally if you have imported java.sql.SQLException this should work. But it’s hard to tell for sure without looking at your code. Please read TellTheDetails.
[EDIT]Modified the incorrect package used as java.sql instead java.lang[/EDIT]