示例#1
0
  /**
   * Constructor of the class
   *
   * @param sqle
   */
  @Override
  public CatchBlock getCatchBlock(Config config) {
    String strSQL = sql == null ? "" : sql.toString();
    if (StringUtil.isEmpty(strSQL)) strSQL = Caster.toString(getAdditional().get("SQL", ""), "");

    String datasourceName = datasource == null ? "" : datasource.getName();
    if (StringUtil.isEmpty(datasourceName))
      datasourceName = Caster.toString(getAdditional().get("DataSource", ""), "");

    CatchBlock sct = super.getCatchBlock(config);
    sct.setEL("NativeErrorCode", new Double(errorcode));
    sct.setEL("DataSource", datasourceName);
    sct.setEL("SQLState", sqlstate);
    sct.setEL("Sql", strSQL);
    sct.setEL("queryError", strSQL);
    sct.setEL("where", "");
    return sct;
  }