Examples of SysException


Examples of com.toc.lib.exception.SysException

public class ExceptionHelper {
  public static GenericException parse(Exception e) {
    try {
      e.printStackTrace();
      return new SysException(null,null);
    } catch(Exception ex) {
      ex.printStackTrace();
      return new SysException(null,null);
    }
  }
View Full Code Here

Examples of ru.vassaev.core.exception.SysException

      } else if (file instanceof InputStream) {
        fr = new InputStreamReader((InputStream) file, charset);
      } else if (file instanceof java.io.Reader) {
        fr = (java.io.Reader) file;
      } else
        throw new SysException("Unsupported type of parameter ('file')");
      String[] vs;
      ArrayList<String> prms = upd.getParamNames();
      int j = 0;
      PreparedStatement st = upd.getStatement(con);
      try {
        while ((vs = Strings.parseXVSLine(fr, sysch, delch)).length > 0) {
          for (int i = prms.size() - 1; i >= 0; i--) {
            String name = prms.get(i);
            Integer ind = names.get(name);
            if ((ind != null) && (vs.length > ind)) {
              upd.setParam(st, name, vs[ind], java.sql.Types.VARCHAR);
            } else {
              upd.setParam(st, name, null, java.sql.Types.VARCHAR);
            }
          }
          st.execute();
          j++;
          if (j % 10 == 0) {
            con.commit();
          }
        }
        con.commit();
      } finally {
        upd.freeStatement(st);
      }
      return true;
    } catch (java.sql.SQLException ex) {
      throw new SysException(ex);
    } catch (IOException ex) {
      throw new SysException(ex);
    } finally {
      Manager.freeConnection(con);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.