Package easyJ.common

Examples of easyJ.common.EasyJException


      // TODO 自动生成 catch 块
      e.printStackTrace();
      String clientMessage = "服务器忙";
      String location = "easyJ.database.dao.SQLServerDAOImpl.rsToArrayList(ResultSet rs, Class oclass)";
      String logMessage = "数据从ResultSet中读取时出错,检查数据库字段";
      EasyJException ee = new EasyJException(e, location, logMessage,
          clientMessage);
      throw ee;
    } catch (InstantiationException e) {
      e.printStackTrace();
      String clientMessage = "服务器忙";
      String location = "easyJ.database.dao.SQLServerDAOImpl.rsToArrayList(ResultSet rs, Class oclass)";
      String logMessage = "类实例化时出错,请检查类:" + oclass + " 是否有不带参数的构造方法";
      EasyJException ee = new EasyJException(e, location, logMessage,
          clientMessage);
      throw ee;
    } catch (IllegalAccessException e) {
      e.printStackTrace();
      String clientMessage = "服务器忙";
      String location = "easyJ.database.dao.SQLServerDAOImpl.rsToArrayList(ResultSet rs, Class oclass)";
      String logMessage = "类实例化时出错,请检查类:" + oclass
          + "的不带参数的构造方法是否是public的";
      EasyJException ee = new EasyJException(e, location, logMessage,
          clientMessage);
      throw ee;
    } finally {
      try {
        if (rs != null) {
View Full Code Here


    } catch (SQLException sqle) {
      sqle.printStackTrace();
      String clientMessage = "服务器忙";
      String location = "easyJ.database.dao.SQLServerDAOImpl.setElement(PreparedStatement psst, ArrayList paramValueList)";
      String logMessage = "对PreparedStatement进行设置的时候出现错误,检查数据的类型是否和数据库的类型匹配";
      EasyJException ee = new EasyJException(sqle, location, logMessage,
          clientMessage);
      throw ee;
    }
    return psst;
  }
View Full Code Here

    } catch (SQLException sqle) {
      sqle.printStackTrace();
      String clientMessage = "服务器忙";
      String location = "easyJ.database.dao.SQLServerDAOImpl.setElement(PreparedStatement psst, ArrayList paramValueList)";
      String logMessage = "对PreparedStatement进行设置的时候出现错误,检查数据的类型是否和数据库的类型匹配";
      EasyJException ee = new EasyJException(sqle, location, logMessage,
          clientMessage);
      throw ee;
    }
    return psst;
  }
View Full Code Here

          String clientMessage = "服务器忙";
          String location = "easyJ.database.connection.ConnectionControllerHardImpl.getConnection()";
          String logMessage = "can't get connection because of ClassNotFoundException: "
                  + ex.getMessage()
                  + ". Please put the JDBC driver to the suitable path. Or the name of the driver is wrong.";
          EasyJException ee = new EasyJException(ex, location, logMessage,
                  clientMessage);
          throw ee;
      } catch (SQLException ex) {
          ex.printStackTrace();
          String clientMessage = "服务器忙";
          String location = "easyJ.database.connection.ConnectionControllerHardImpl.getConnection()";
          String logMessage = "can't get connection because of SQLException: "
                  + ex.getMessage()
                  + ". Please check the url and user and password";
          EasyJException ee = new EasyJException(ex, location, logMessage,
                  clientMessage);
          throw ee;
      }
  }
View Full Code Here

        } catch (NamingException ne) {
            ne.printStackTrace();
            String clientMessage = "服务器忙";
            String location = "easyJ.database.connection.ConnectionControllerTomcatImpl.getEnvironmentContext()";
            String logMessage = "can't find the environment with JNDI name 'java:comp/env' Please make sure the datasource is configured with the JNDI name.";
            EasyJException ee = new EasyJException(ne, location, logMessage,
                    clientMessage);
            throw ee;
        }
    }
View Full Code Here

                lga.login(user);
            }
        }

        if (GenericValidator.isBlankOrNull(className)) {
            throw new EasyJException(
                    null,
                    "easyJ.http.servlet.RequestProcessor.processPopulate(HttpServletRequest request,HttpServletResponse response)",
                    "servlet没有能够得到要处理的数据,请查看生成客户端的代码", "服务器忙");
        }
View Full Code Here

                String clientMessage = "服务器忙";
                String location = "easyJ.database.connection.ConnectionControllerTomcatImpl.lookupDataSource()";
                String logMessage = "can't find the datasource with JNDI name "
                        + dsName
                        + ". Please make sure the datasource is configured with the JNDI name.";
                EasyJException ee = new EasyJException(ne, location,
                        logMessage, clientMessage);
                throw ee;
            } catch (Exception e) {
                if (e instanceof EasyJException) {
                    throw (EasyJException) e;
                }
                e.printStackTrace();
                String clientMessage = "服务器忙";
                String location = "easyJ.database.connection.ConnectionControllerTomcatImpl.lookupDataSource()";
                String logMessage = "Unexcepted exception occurs, can't initial context because of exception:"
                        + e.getMessage();
                EasyJException ee = new EasyJException(e, location, logMessage,
                        clientMessage);
                throw ee;
            }
        }
    }
View Full Code Here

            se.printStackTrace();
            String clientMessage = "服务器忙";
            String location = "easyJ.database.connection.ConnectionControllerTomcatImpl.getConnection()";
            String logMessage = "can't get connection because of SQLException: "
                    + se.getMessage();
            EasyJException ee = new EasyJException(se, location, logMessage,
                    clientMessage);
            throw ee;
        }
    }
View Full Code Here

    String[] accurateProperties = { "userName", "password" };
    dp.setAccurateProperties(accurateProperties);

    ArrayList users = dp.query(user);
    if (users.size() == 0) {
      throw new EasyJException(null,
          "cn.dr.requirement.elicitation.action.LoginAction", user
              .getUserName()
              + "的用户名密码错", "用户名密码错");
    } else if (!((SysUser) users.get(0)).getPassword().equals(
        user.getPassword())) {

      throw new EasyJException(null,
          "cn.dr.requirement.elicitation.action.LoginAction", user
              .getUserName()
              + "的用户名密码错", "用户名密码错");
    }
View Full Code Here

        } catch (SQLException ex) {
            ex.printStackTrace();
            String clientMessage = "服务器忙";
            String location = "easyJ.database.session.SessionImpl.beginTransaction()";
            String logMessage = "设置事务非自动提交出错,错误信息:" + ex.getMessage();
            EasyJException ee = new EasyJException(ex, location, logMessage,
                    clientMessage);
            throw ee;
        }

        Transaction transaction = TransactionFactory.getTransaction();
View Full Code Here

TOP

Related Classes of easyJ.common.EasyJException

Copyright © 2018 www.massapicom. 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.