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]
Take a look at SQLException API. Can you find a constructor for SQLException class that takes an SQLException instance as a parameter?
Anyway, why would you catch an SQLException to throw another SQLException after one line?
Hello,
The Constructor that you are using is available only from Java 1.6.
I suppose you are using version which is lower than 1.6. That is the reason its not able to compile.
Moreover if you just want re-throw the SQLException then you may not need to create a new instance of SQLException. Instead you can use "e" e.g throw e;