我需要知道如何在java中获取由异常生成的消息的特定部分,在调试模式下,我已经获得了我需要的值,附加了图像,但我需要在代码中获取该数据以生成一个“开关”,我需要这样的东西:
try
{
processes ....
} catch (SQLException ex) {
string reason = ex.**(how to get the failure reason)**;
switch (reason) {
case "_bt_check_unique":
JOptionPane.showMessageDialog (null, "Error, the record already exists.");
break;
}