the code:
Job job = new Job("Connect to Database") {
@Override
protected IStatus run(IProgressMonitor monitor) {
monitor.beginTask("正在建立到数据库的连接 ...", 100);
try {
Thread.sleep(3000);
database = new Database(cp.getName(), cp.getConnection());
} catch (Exception e) {
e.printStackTrace();
IStatus sqlErrorStatus = new Status(IStatus.ERROR, "amarsoft.dbmp", e.getMessage(), null);
StatusManager.getManager().handle(sqlErrorStatus, StatusManager.SHOW);
}
monitor.done();
return Status.OK_STATUS;
}
};

How can I get it to display an exception stack trace when the user clicks the Details button?
source
share