public void onClick() throws SQLException
try {
// Do something
} catch(MySQLIntegrityConstraintViolationException e) {
//Can i convert this exception to SQL Exception
}
我可以将MySQLIntegrityConstraintViolationException转换为该方法抛出的SQLException吗?在catch块内抛出异常
你绝对正确(“不要只是传递信息......”),但看到我更新的答案。 –